![]() |
||||
Download Policy: Content on the Website is provided to you AS IS for your information and personal use only and may not be sold or licensed nor shared on other sites. SlideServe reserves the right to change this policy at anytime.
While downloading, If for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
1. CHAPTER 6:The Little Man Computer The Architecture of Computer Hardware and Systems Software: An Information Technology Approach
3rd Edition, Irv Englander
John Wiley and Sons ?2003
Linda Senne, Bentley College
Wilson Wong, Bentley College
2. Chapter 6 Little Man Computer 6-2 Introduction The power of the computer does not arise from complexity. Instead, the computer has the ability to perform simple operations at an extremely high rate of speed.
These operations can be combined to provide the computer capabilities that you are familiar with.
3. Chapter 6 Little Man Computer 6-3 LMC – Little Man Computer Original was created by Dr. Stuart Madnick at MIT in 1965.
He produced a newer version in 1979. The newer version has a slightly modified instruction set. We will use the modified version.
4. Chapter 6 Little Man Computer 6-4 The Little Man Computer
5. Chapter 6 Little Man Computer 6-5 Mailboxes: Address vs. Content Addresses are consecutive
Content may be
Data or
Instructions
6. Chapter 6 Little Man Computer 6-6 Content: Instructions Op code
Operation code
Arbitrary mnemonic
Operand
Object to be manipulated
Data or
Address of data
7. Chapter 6 Little Man Computer 6-7 Magic! Load program into memory
Put data into In Basket
8. Chapter 6 Little Man Computer 6-8 Assembly Language Specific to a CPU
1 to 1 correspondence between assembly language instruction and binary (machine) language instruction
Mnemonics (short character sequence) represent instructions
Used when programmer needs precise control over hardware, e.g., device drivers
9. Chapter 6 Little Man Computer 6-9 Instruction Set –Direct Addressing
10. Chapter 6 Little Man Computer 6-10 Instruction Set –LOAD (Direct)
11. Chapter 6 Little Man Computer 6-11 Instruction Set –STORE (Direct)
12. Chapter 6 Little Man Computer 6-12 Instruction Set –ADD (Direct)
13. Chapter 6 Little Man Computer 6-13 Instruction Set –SUB (Direct)
14. Chapter 6 Little Man Computer 6-14 Instruction Set –INPUT
15. Chapter 6 Little Man Computer 6-15 Instruction Set –OUTPUT
16. Chapter 6 Little Man Computer 6-16 Instruction Set –HALT
17. Chapter 6 Little Man Computer 6-17 Instruction Set –SKIP
18. Chapter 6 Little Man Computer 6-18 Instruction Set –JUMP (Direct)
19. Chapter 6 Little Man Computer 6-19 What does this program do? 00 IN;
01 STA 99;
02 IN;
03 ADD 99;
04 OUT;
05 HLT;
Write the opcode.
20. Chapter 6 Little Man Computer 6-20 What does this program do? 00 IN;
01 STA 99;
02 IN;
03 STA 98;
04 ADD 99;
05 STA 97;
06 LDA 99;
07 OUT;
08 LDA 98;
09 OUT;
10 LDA 97;
11 OUT;
12 HLT;
21. Chapter 6 Little Man Computer 6-21 Write a program to… Enter two number. Find (and output) the sum of twice the first number plus the second number.
Enter two number. Compute the sum of twice the first number and three times the second number. Output the first number, then the second number, then the result.
22. Chapter 6 Little Man Computer 6-22 INDIRECT ADDRESSING
23. Chapter 6 Little Man Computer 6-23 Instruction Set –LOAD (Indirect)
24. Chapter 6 Little Man Computer 6-24 Instruction Set –STORE (Indirect)
25. Chapter 6 Little Man Computer 6-25 Instruction Set –ADD (Indirect)
26. Chapter 6 Little Man Computer 6-26 Instruction Set –SUB (Indirect)
27. Chapter 6 Little Man Computer 6-27 Instruction Set –JUMP (Indirect)
28. Chapter 6 Little Man Computer 6-28 Immediate Addressing
29. Chapter 6 Little Man Computer 6-29 Instruction Set –LOAD (Immediate)
30. Chapter 6 Little Man Computer 6-30 Instruction Set –ADD (Immediate)
31. Chapter 6 Little Man Computer 6-31 Instruction Set –SUB (Immediate)
32. Chapter 6 Little Man Computer 6-32 Indirect, Immediate, Direct 00 IN;
01 STA 99;
02 ADD #05;
03 STA *99;
04 ADD *99;
05 OUT;
06 SUB *99;
07 OUT;
08 HLT;
33. Chapter 6 Little Man Computer 6-33 Indirect, Immediate, Direct 00 IN; Input a number > 10 to the calculator
01 STA 99; Direct Addressing--Store data in calc to mailbox 99
02 ADD #05; Add the number five to the calculator
03 STA *99; Indirect addressing- Store contents of calculator
; to the mailbox pointed to by the contents
; of mailbox 99
04 ADD *99; Indirect addressing; Add contents of mailbox pointed by 99 to contents of the calculator
05 OUT;
06 SUB *99; Indirect addressing-- Subtract contents of mailbox ;pointed to by the contents of mailbox 99
07 OUT; Print out result in calculator to output basket
08 HLT; End program
34. Chapter 6 Little Man Computer 6-34 Counting Forward INFINITE 00 LDA 90;
01 OUT;
02 ADD #01;
03 STA 90;
04 JMP 01;
05 HLT;
90 DAT 00;
35. Chapter 6 Little Man Computer 6-35 Counting up to an enter num 00 IN;
01 STA 99;
02 LDA 90;
03 OUT;
04 ADD #01;
05 STA 90;
06 LDA 99;
07 SUB #01;
08 SKN;
09 JMP 01;
10 HLT;
90 DAT 00;
36. Chapter 6 Little Man Computer 6-36 LMC Input/Output
37. Chapter 6 Little Man Computer 6-37 LMC Internal Data
38. Chapter 6 Little Man Computer 6-38 Data storage location Physically identical to instruction mailbox
Not located in instruction sequence
Identified by DAT mnemonic
39. Chapter 6 Little Man Computer 6-39 LMC Arithmetic Instructions
40. Chapter 6 Little Man Computer 6-40 Instruction Cycle Fetch: Little Man finds out what instruction he is to execute
Execute: Little Man performs the work.
41. Chapter 6 Little Man Computer 6-41 Fetch Portion ofFetch and Execute Cycle
42. Chapter 6 Little Man Computer 6-42 Fetch, cont.
43. Chapter 6 Little Man Computer 6-43 Execute Portion
44. Chapter 6 Little Man Computer 6-44 Execute, cont.
45. Chapter 6 Little Man Computer 6-45 von Neumann Architecture (1945) Stored program concept
Memory is addressed linearly
Memory is addressed without regard to content