3 BIT Computer Simulator - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

3 BIT Computer Simulator

Description:

3BIT simulator was developed by Brian Farrimond when he was Pathway ... Snippets. So far you have only seen snippets of 3 BIT. This is so as not to confuse you ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 32
Provided by: ChrisBe151
Category:

less

Transcript and Presenter's Notes

Title: 3 BIT Computer Simulator


1
3 BIT Computer Simulator
  • Stewart Blakeway,
  • FML208,
  • blakews_at_hope.ac.uk
  • 0151 291 3113 
  • http//hopelive.hope.ac.uk/computing/

2
3BIT
  • 3BIT simulator was developed by Brian Farrimond
    when he was Pathway leader for Information
    Technology
  • It was designed to teach students what goes on
    inside the computer.
  • 3BIT progresses from simple processes to more
    complicated and has various components attached
    to its BUS

3
What is 3BIT?
  • 3Bit is a 3Bit computer simulator.
  • It has various instructions that will manipulate
    how the data stored in memory is processed
  • If we are only using 3BITs of memory for the
    processor instructions. How many instructions do
    we have?

23 or 8
4
8 Instructions
  • Which is a good thing. Because you have to
    memorise all 8 instructions to be able to get the
    most out of the simulator!
  • LDI
  • LDD
  • STD
  • ADD
  • SUB
  • STP
  • JMP
  • JEZ

5
Lets look at the more obvious ones first!
  • ADD Will add the contents of the memory address
    specified to whatever is in the ACCUMULATOR
  • SUB - Will subtract the contents of the memory
    address specified from the ACCUMULATOR
  • STP Will stop the execution of the instructions

6
The CPU
  • Every CPU has at least 3 registers
  • Accumulator
  • Instruction Register
  • Program Counter

7
ACUMULATOR
  • What is an accumulator?
  • a register or electric device on an arithmetic
    machine (eg adding machine, cash register, or
    digital computer)
  • that receives a number and produces and stores
    the results of arithmetic operations of the given
    number with other numbers.

8
INSTRUCTION REGISTER
  • What is an Instruction Register?
  • part of a CPUs control unit that stores the
    instruction currently being executed
  • in simple processors each instruction to be
    executed is loaded into the instruction register
  • which holds it while it is decoded, prepared and
    ultimately executed

9
PROGRAM COUNTER
  • What is a Program Counter?
  • A register in a computer which indicates where
    the computer is in its instruction sequence.
  • Depending on the details of the particular
    machine, it holds either the address of the
    instruction being executed, or the address of the
    next instruction to be executed

10
3BIT CPU
  • IR (INSTRUCTION REGISTER)
  • AC (ACCUMULATOR)
  • PC (PROGRAM COUNTER)
  • In the program these labels also act as reset
    buttons. Click them to reset the values in the
    registers.
  • Run will run through the program executing one
    instruction after the other
  • Step will execute one instruction and wait for
    you to click step before executing the next.

11
Where are the Instructions Stored?
  • A CPU can only execute one instruction at a time.
  • Where are the other instructions stored?
  • The Instructions are stored in RAM. They are
    fetched and then executed.
  • This is known as the fetch and execute cycle

12
3BIT and Memory
  • Our simulator has 32 Memory Locations
  • Each location can store one byte.
  • Enough memory in each location to store a
    character
  • Real Memory has billions of locations.

13
Question
  • How Many Bits in a Byte?
  • Why is it called 3BIT?

8 Bits in a byte
3 BITS for the INSTRUCTION 5 BITS for the DATA
14
OP CODE and OPERAND
  • The OP CODE is the instruction. The Operation
    Code. It uses 3 Bits so there are 8 possible
    instructions.
  • The OPERAND is the data that is related to the
    instruction. 5 Bits are used for the OPERAND

15
3BIT Memory
  • Notice that some of the memory locations have red
    lines coming from them.
  • This is to signify that that section of the
    memory has been reserved for use with the Video
    Card

16
Back to the Instructions
  • ADD Will add the contents of the memory address
    specified to the accumulator
  • SUB - Will subtract the contents of the memory
    address specified from the accumulator
  • It is very important to realise now that when you
    specify ADD x. The x refers to a memory
    location. Not a value!

17
For Example
Answer 10 plus 2 equals 12
  • Question What will the AC become once the
    program has finished executing?
  • Address 16 holds value 10.
  • Address 10 holds value 2

18
Lets take a look at the other Instructions?
  • LDD
  • Load contents of location x into the AC
  • STD
  • Transfer the contents of the AC to location x

19
LDD
  • Given the program in memory, what will the
    accumulators state be once the program has
    executed?
  • Answer 75

20
STD
  • Given the following program.
  • What will happen?

21
5/8
  • We have covered 5 Instructions and how they work
  • LDD, STD, ADD, SUB, STP
  • What about the other 3?
  • LDI, JMP, JEZ

22
LDI
  • LDI is similar to LDD with one key difference.
  • LDI 27 will load 27 into the AC
  • LDD 27 what does this do???

23
JMP
  • JMP is a Jump command. IT CHANGES THE EXECUTION
    OF THE PROGRAM BY CHANGING THE CONTENTS OF THE
    PROGRAM COUNTER TO THE ADDRESS SPECIFIED
  • JMP 10, will start executing the program from
    memory position 10

24
JEZ
  • JEZ is similar to JMP but it will only jump if
    the AC is equal to zero
  • Jump if Equal to Zero

25
JEZ
  • Given the following program
  • What will happen?

26
Thats eight instructions
  • All eight instructions.
  • You have to learn and memorise the instructions
  • You will start programming in 3BIT soon.

27
CPU
  • The CPUs processing power is measured with a
    clock speed.
  • The higher the speed the quicker the CPU will
    process instructions
  • MHz
  • GHz

28
3BIT and the clock speed
  • 3 BIT has a clock speed too.
  • By default it is set to 0.3 Hz
  • Very slow, this is deliberate so that you can see
    the instructions being executed
  • The clock speed can be changed to
  • 0.2 Hz
  • 10 Hz
  • 50 Hz

29
Snippets
  • So far you have only seen snippets of 3 BIT.
  • This is so as not to confuse you
  • What have we covered?
  • The CPU
  • The Memory
  • The CPU Clock Speed

30
What is left?
  • The Hard Disk
  • The Display (pixel and character)
  • The Printer
  • The Keyboard
  • The Network Card (frame buffers,
  • Computers 1 and 2

31
What do you need to do next?
  • You need to learn all 8 instructions
  • Your tutor will expect you to know these
    instructions
  • You will be given programming exercises to
    complete in 3BIT they progressively get harder
    to very hard!
Write a Comment
User Comments (0)
About PowerShow.com