Little Man Computer - PowerPoint - PowerPoint by Gq5ec4V

VIEWS: 102 PAGES: 12

									            Little Man Computer

•   layout of LMC
•   functionality of LMC
•   LMC instruction set
•   LMC instruction codes
•   a simple program
•   fetch-execute instruction cycle
•   von Neumann architecture
                                      1
Figure 6.1 The Little Man Computer   2
      LMC (Basic) Instructions
•   LOAD
•   STORE
•   ADD
•   SUBTRACT
•   INPUT
•   OUTPUT
•   HALT
                                 3
                Code Format
               Instruction      mailbox
                                address

                   5               25



                Instruction 5 == LOAD

Code 525 == LOAD value from mailbox 25 onto calculator

                                                         4
        LMC (Basic) Codes
•   LOAD       5 | mailbox
•   STORE      3 | mailbox
•   ADD        1 | mailbox
•   SUBTRACT   2 | mailbox
•   INPUT      9 | 01
•   OUTPUT     9 | 02
•   HALT       0 | 00
                             5
          A Simple Program
Mailbox   Code   Meaning

 00       901
 01       399
 02       901
 03       199
 04       902
 05       000

                             6
Figure 6.5a The fetch portion of the instruction cycle   7
Figure 6.5b The execute portion of the instruction cycle (LOAD instruction)
                                                                         8
Figure 6.5b (continued)   9
 Is the LMC a “real” computer?

• What can it really do?

• What can it not do?

• What are the limitations of the LMC?

                                         10
      LMC to “real” computer
• LMC also uses fetch-execute cycles
• LMC processes instructions in sequence

• Mailboxes are memory
• LM and calculator are CPU
• Baskets provide I/O

                                           11
               Summary

• LMC is a real computer!

• Computers are simple
• Programming is easy



                            12

								
To top