Presentation is loading. Please wait.

Presentation is loading. Please wait.

CHAPTER 6: The Little Man Computer The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander.

Similar presentations


Presentation on theme: "CHAPTER 6: The Little Man Computer The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander."— Presentation transcript:

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 The Little Man Computer

3 Chapter 6 Little Man Computer 6-3 Mailboxes: Address vs. Content Addresses are consecutive Content may be Data or Instructions AddressContent

4 Chapter 6 Little Man Computer 6-4 Content: Instructions Op code Operation code Arbitrary mnemonic Operand Object to be manipulated Data or Address of data AddressContent Op codeOperand

5 Chapter 6 Little Man Computer 6-5 Magic! Load program into memory Put data into In Basket

6 Chapter 6 Little Man Computer 6-6 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

7 Chapter 6 Little Man Computer 6-7 Instruction Set Arithmetic1xxADD 2xxSUB Data Movement3xxSTORE 5xxLOAD Input/Output901INPUT 902Output Machine Control (coffee break) 000STOP COB

8 Chapter 6 Little Man Computer 6-8 Input/Output Move data between calculator and in/out baskets Content Op CodeOperand (address) IN (input) 901 OUT (output) 902

9 Chapter 6 Little Man Computer 6-9 LMC Input/Output IN OUT

10 Chapter 6 Little Man Computer 6-10 Internal Data Movement Between mailbox and calculator Content Op CodeOperand (address) STO (store) 3xx LDA (load) 5xx

11 Chapter 6 Little Man Computer 6-11 LMC Internal Data LDA STO

12 Chapter 6 Little Man Computer 6-12 Data storage location Physically identical to instruction mailbox Not located in instruction sequence Identified by DAT mnemonic

13 Chapter 6 Little Man Computer 6-13 Arithmetic Instructions Read mailbox Perform operation in the calculator Content Op CodeOperand (address) ADD 1xx SUB 2xx

14 Chapter 6 Little Man Computer 6-14 LMC Arithmetic Instructions ADD SUB

15 Chapter 6 Little Man Computer 6-15 Simple Program: Add 2 Numbers Assume data is stored in mailboxes with addresses >90 Write instructions Input a # Store the # Input a # Add Output the number

16 Chapter 6 Little Man Computer 6-16 Program to Add 2 Numbers: Using Mnemonics MailboxMnemonicInstruction Description 00IN;input 1 st Number 01STO 99;store data 02IN;input 2 nd Number 03ADD 99;add 1 st # to 2 nd # 04OUT;output result 05COB;stop 99DAT 00;data

17 Chapter 6 Little Man Computer 6-17 Program to Add 2 Numbers MailboxCodeInstruction Description 00901;input 1 st Number 01399;store data 02901;input 2 nd Number 03199;add 1 st # to 2 nd # 04902;output result 05000;stop 99000;data

18 Chapter 6 Little Man Computer 6-18 Program Control Branching (executing an instruction out of sequence) Changes the address in the counter Halt Content Op CodeOperand (address) BR (Jump) 6xx BRZ (Branch on 0) 7xx BRP (Branch on +) 8xx COB (stop) 0(ignore)

19 Chapter 6 Little Man Computer 6-19 Instruction Set Arithmetic1xxADD 2xxSUB Data Movement3xxSTORE 5xxLOAD BR6xxJUMP BRZ7xxBRANC ON 0 BRP8xxBRANCH ON + Input/Output901INPUT 902OUTPUT Machine Control (coffee break) 000HALT COB

20 Chapter 6 Little Man Computer 6-20 Find Positive Difference of 2 Numbers 00IN901 01STO IN901 03STO SUB BRP 08808;test 06LDA 10510;if negative, reverse order 07SUB OUT902;print result and 09COB000;stop 10DAT 00000;used for data 11DAT 00000;used for data

21 Chapter 6 Little Man Computer 6-21 Instruction Cycle Fetch: Little Man finds out what instruction he is to execute Execute: Little Man performs the work.

22 Chapter 6 Little Man Computer 6-22 Fetch Portion of Fetch and Execute Cycle 1. Little Man reads the address from the location counter 2. He walks over to the mailbox that corresponds to the location counter

23 Chapter 6 Little Man Computer 6-23 Fetch, cont. 3. And reads the number on the slip of paper (he puts the slip back in case he needs to read it again later)

24 Chapter 6 Little Man Computer 6-24 Execute Portion 1. The Little Man goes to the mailbox address specified in the instruction he just fetched. 2. He reads the number in that mailbox (he remembers to replace it in case he needs it later).

25 Chapter 6 Little Man Computer 6-25 Execute, cont. 3. He walks over to the calculator and punches the number in. 4. He walks over to the location counter and clicks it, which gets him ready to fetch the next instruction.

26 Chapter 6 Little Man Computer 6-26 von Neumann Architecture (1945) Stored program concept Memory is addressed linearly Memory is addressed without regard to content

27 Chapter 6 Little Man Computer 6-27 Copyright 2003 John Wiley & Sons All rights reserved. Reproduction or translation of this work beyond that permitted in Section 117 of the 1976 United States Copyright Act without express permission of the copyright owner is unlawful. Request for further information should be addressed to the permissions Department, John Wiley & Songs, Inc. The purchaser may make back-up copies for his/her own use only and not for distribution or resale. The Publisher assumes no responsibility for errors, omissions, or damages caused by the use of these programs or from the use of the information contained herein.


Download ppt "CHAPTER 6: The Little Man Computer The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander."

Similar presentations


Ads by Google