Sei sulla pagina 1di 34

Computer System Low- Level Techniques

CT073-3-2

Little Man Computer


Topic & Structure of The Lesson

• Comparison between Little Man


Computer Components With Original
Computer Components.
• Introduction to Assembly language
programming (Little Man Computer
programs).

CT073-2-3 and CSLLT LMC Slide ‹2› of 34


Learning Outcomes

• At the end of this session you should be


able to
– Compare the LMC components with
Computer Components.
– Write LMC programs.
– Understand the internal operations of the
Computer.

CT073-2-3 and CSLLT LMC Slide ‹3› of 34


Key Terms You Must Be Able To
Use
• If you have mastered this topic, you should be able to use the following
terms correctly in your assignments and exams:

– Instruction cycle
– Mnemonics
– Opcode
– Linear memory addressing
– Little Man Computer
– Von Neumann architecture

CT073-2-3 and CSLLT LMC Slide ‹4› of 34


The Little Man Computer

CT073-2-3 and CSLLT LMC Slide ‹5› of 34


The Little Man Computer
1. Walled Mailroom
2. Mailboxes - 100
i. address in the range [ 00 - 99 ]
ii. content - slip of paper with a three-digit
number
3. Calculator
i. accumulator (temporary storage of result)
ii. addition and subtraction (2s Complement)

CT073-2-3 and CSLLT LMC Slide ‹6› of 34


The Little Man Computer
4. Hand-Counter (2-digit)
i. can increment by clicking
ii. reset located outside the mailroom
5. Little Man
6. In-basket
i. Communicating with outside world (three-
digit decimal number)
7. Out-basket

CT073-2-3 and CSLLT LMC Slide ‹7› of 34


The Little Man Computer

CT073-2-3 and CSLLT LMC Slide 8› of 34


Typical Instruction of the LMC

OPCODE OPERAND OR ADDRESS

1 decimal digit 2 decimal digits

OPCODE => OPeration CODE

CT073-2-3 and CSLLT LMC Slide ‹9› of 34


Types of Instructions of the LMC

CT073-2-3 and CSLLT LMC Slide ‹10› of 34


Types of Instructions of the LMC

CT073-2-3 and CSLLT LMC Slide ‹11› of 34


Types of Instructions of the LMC

CT073-2-3 and CSLLT LMC Slide ‹12› of 34


Types of Instructions of the LMC

Opcod Instructio
Description
e n
The LM goes to the in basket
INPUT and reads the 3-digit number on
9 With address slip of paper and goes over to
01 the calculator and enters it.
(Accumulator)
The LM goes over to the
OUTPUT calculator and takes the 3-digit
9 With address number, puts it on a slip of
02 paper and places it in the out
basket.
CT073-2-3 and CSLLT LMC Slide ‹13› of 34
Program to add two numbers

CT073-2-3 and CSLLT LMC Slide ‹14› of 34


Little Man Mnemonic Instruction
Codes

CT073-2-3 and CSLLT LMC Slide ‹15› of 34


LMC PROGRAM WHAT’S
HAPPENING HERE?

CT073-2-3 and CSLLT LMC


LMC
.

CT073-2-3 and CSLLT LMC Slide ‹17› of 34


Actual Computer

CT073-2-3 and CSLLT LMC Slide ‹18› of 34


The Instruction Cycle of the LMC

• FETCH PHASE
• DECODE PHASE
• EXECUTE PHASE

CT073-2-3 and CSLLT LMC Slide ‹19› of 34


The FETCH Phase
Step1: Use the value of hand counter (HC) to refer to Mailbox

CT073-2-3 and CSLLT LMC Slide ‹20› of 34


The FETCH Phase
Step2: Approach the Mailbox with the hand counter (HC)
address

CT073-2-3 and CSLLT LMC


The DECODE Phase
Step3: Read the Instruction from Mailbox (and decode)

CT073-2-3 and CSLLT LMC


The DECODE Phase
Step4:Use address in Instruction to refer Mailbox
(data)

CT073-2-3 and CSLLT LMC


The DECODE Phase
Step5: Read the data from Mailbox

CT073-2-3 and CSLLT LMC Slide ‹24› of 34


The EXECUTE Phase
Step6: Puts contents into the Calculator

CT073-2-3 and CSLLT LMC Slide ‹25› of 34


The EXECUTE Phase
Step7: Increment the hand counter (HC) to point to next Instruction

CT073-2-3 and CSLLT LMC Slide ‹26› of 34


Von Neumann Architecture

• Between 1945 and 1951 Von Neumann


set down a series of guidelines that is
known as the Von Neumann
Architecture for Computers.
• It is significant in the sense that despite
massive technological changes
occurring almost overnight, the
architecture of Computers is virtually
unchanged since 1951.
CT073-2-3 and CSLLT LMC Slide ‹27› of 34
Von Neumann Architecture -
Guidelines
• Stored Program Concept
– Memory holds both program instructions as well
as data.
• Linear addressing
– Memory is addressed linearly which means there
is a single sequential numeric address for each
and every memory location.
• Independence of data and address
– Memory is addressed by the location number
without regard to the data contained within.

CT073-2-3 and CSLLT LMC Slide ‹28› of 34


Von Neumann Architecture -
Guidelines
• Sequential processing of instructions
– All instructions of the program are
processed in sequence and the current
instruction being executed is decided by
the program counter.
• Functional Computer organisation
– Comprises of the Control Unit, Arithmetic
and Logic Unit and Registers, together
known as the Central Processing Unit or
CPU.
CT073-2-3 and CSLLT LMC Slide ‹29› of 34
Quick Review Question

1. Write an LMC program to produce the


sum of three input values.
2. Write an LMC program that able to
calculate the perimeter of a rectangle,
based on two input values.

CT073-2-3 and CSLLT LMC Slide ‹30› of 34


Follow Up Assignment

• Discuss the internal operations of a


computer using the Little Man Computer
Operations.

CT073-2-3 and CSLLT LMC Slide ‹31› of 34


Summary of Main Teaching Points
.

CT073-2-3 and CSLLT LMC Slide ‹32› of 34


Question and Answer Session

Q&A

CT073-2-3 and CSLLT LMC Slide ‹33› of 34


What we will cover next

• Tutorial
– Writing LMC programs.

CT073-2-3 and CSLLT LMC Slide ‹34› of 34

Potrebbero piacerti anche