Chapter 6 - The Little Man Computer
Chapter 6 - The Little Man Computer
· This chapter starts the coverage of the hardware component of the computer system architecture
· The following main topics will be covered:
o Layout of the Little Man Computer (LMC)
o Operations of LMC
o Programming in LMC
o The instruction cycle
Layout of LMC
· This chapter discusses a classical computer model, called the Little Man Computer (LMC)
· LMC is a simplified computer prototype to help explain the computer hardware architecture
· LMC was originally developed in 1965
· In 1979, LMC was slightly modified
· 37 years after its introduction, LMC still provide an accurate representation of the real computer
design and operation
· The following fundamental computer architecture concepts will be outlined through the LMC
discussion:
o Organization and physical layout of a typical computer system
o Role of CPU
o Role of memory
o Role of Input/Output devices
o The instruction set
o How the LMC execute instructions (i.e. fetch-execute cycle)
o How simple instructions can be used to write software programs
o The stored program concept
Operations of LMC
· Note: Op code 4 is not defined (may be used for future expansion of the instruction set)
· The instructions in the LMC instruction set can be divided into 5 categories
o Data movement (LOAD, STORE)
o Arithmetic calculations (ADD, SUBTRACT)
o I/O operations (INPUT, OUTPUT)
o Control operations (HALT)
o Flow control (BR, BRZ, BRP)
Program 1: add 2 numbers and write the result to the out basket
00 901 INPUT read 1st number from in basket and store into calculator
01 399 STORE 99 store number in calculator into mailbox 99
02 901 INPUT read 2nd number from in basket and store it into calculator
03 199 ADD 99 calculator = (calculator content + content of mailbox 99)
04 902 OUTPUT write content of calculator and put it in the out basket
05 000 HALT end execution
99 DATA mailbox contain data (1st number)
Program 2: find positive difference of 2 numbers and write the result to the out basket
· Note: this program uses mnemonics instead of full instruction name
00 901 IN read 1st number from in basket and store it into calculator
01 310 STO 10 store content of calculator (1st number) into mailbox 10
02 901 IN read 2nd number from in basket and store it into calculator
03 311 STO 11 store content of calculator (2nd number) into mailbox 11
04 210 SUB 10 calculator = calculator - number in mailbox 10 (2nd – 1st number)
05 808 BRP 08 if result is positive, already got the positive difference, so just
output
06 510 LDA 10 load content of mailbox 10 into calculator (1st number)
07 211 SUB 11 calculator = calculator - number in mailbox 11 (1st – 2nd number)
08 902 OUT write content of calculator and put it in the out basket (difference)
09 000 HLT end execution
10 DAT mailbox contain data (first number)
11 DAT mailbox contain data (second number)
· The LMC emulator is Windows based software application to emulates the LMC
· It provides capabilities for interactive and visual writing and execution of LMC programs
· In assignment 3 you will be asked to use the emulator to test your LMC programs
· Live demo…