Top Banner
A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information around the CPU. COULD explain the need for and use of registers during the fetch decode execute cycle Create solutions to the LMC assignments
14

A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

Dec 26, 2015

Download

Documents

Clifton Hawkins
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Session Objectives#5

MUST identify different buses and registers used in a CPU

SHOULD describe the use of buses to send information around the CPU.

COULD explain the need for and use of registers during the fetch decode execute cycle

Create solutions to the LMC assignments

Page 2: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Visit the following site and follow the simulations of the Fetch-Execute cycle using the Little Man Computer (LMC)http://www.cs.ru.nl/~erikpoll/III/dag4.html

This is an interpretation of how a processor handles machine code. TASK: Follow the instructions and create a flow diagram of where the Little Man goes to throughout the Fetch Execute Cycle. REMEMBER: Instructions are split into 2 parts, the instruction (+,-, x, store etc) and the data itself (or memory location/address of where the data to be used is stored)1) The Op Code (or Operation Code Field) is part of the binary code giving the instruction to be carried out i.e add or jump2) The Operand (Operand Field or address field) gives the address (memory location) where the data to be used in the operation is stored.

Machine Code with The Little Man Computer

Page 3: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Little Man Code Library

CODE MEANING1ab Load2ab Store3ab Add4ab Subtract500 Input600 Output700 Stop800 Skip If Negative801 Skip If Zero802 If Skip Positive9AB Jump

Beware: the Little Man 0 is a positive number, so the instruction 802 is actually Skip if Non-negative.

Page 4: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Little Man

Which parts of the processor does each LCM item belong to?

Page 5: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

System Block Diagram

Page 6: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Little Man Machine Code Tasks

Assignments1. Create a simple that will add any 2 numbers and display the results.2. Create a simple programs that will calculate the perimeter of any rectangle.3. Create a program using the LMC to allow the input of 2 integer values and then order them to output the largest value first and then the smallestRGB conversion SW 4. Colors of a pixel on a color are often represented with three values (r, g, b) that the red, green and blue value display. Grayscale on a monochrome display are represented by only one gray value. Choose a program that adds three inputs and divide by three, and so rgb values to the grayscale.

Page 7: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Flow Chart to LMC Assignment 1

Input A

Store A

Add BLoad A

Store B

Input B

Output Result

START

END

Page 8: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Coded Solution to Assignment

00 500 01 299 02 50003 29804 19905 39806 600

INPUT A

STORE Value A at memory location (address 99)

INPUT B

LOAD A

ADD B

OUTPUT Result

STORE Value B at address 98

Page 9: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Flow Chart

Flow chart of solution to LMC Assignment 3

Page 10: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

More on Buses

The signals being sent around the processor are again called buses. These components are the information highway for the CPU. Buses are bundles of tiny wires that carry data between components. The three most important buses are the address, the data, and the control buses.

3 buses you need to remember are:

The Control Bus – The CU uses this to send commands to different parts of the processor or devices in the computer, for requesting a disk drive to read or write.

The Address Bus – carries the location address to where the data is going.

The Data Bus – carries the actual data being used.

Page 11: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Registers

Know that we have a greater understanding of a processort and the Fetch-Execute cycle, we should now consider the CPU of being composed of five basic components: RAM, registers, buses, the ALU, and the Control Unit.

Registers are special memory locations that can be accessed very fast. They keep a check on the progress of the instructions and data as it moves around the processor.

Think of them as part of a logical operation rather than individual registers.

Page 12: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Regsiters

Program Counter (PC) – In the CU. Counts the instructions as they are carried out and increments by (+1). Contains the address of the next instruction to be executed(Instructions are always stored in order)

Memory Address Register (MAR) –stores the address of the memory location currently in use, sent by the PC. Memory Data Register (MDR) – A copy of the instruction held in the MAR is stored here so that the memory unit and processor can work on it at the same time.

Current Instruction Register (CIR) – the instruction now in the MDR is copied into the CIR. In here it can be spilt into 2 parts; 1 part is sent to be decoded so that the processor knows what the instruction is (and signals can be sent to other parts of the processor which may be required to carry out the instruction). The other part is an address stating whereabouts in the memory the required data is.

Page 13: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

Registers

CIR continued...E.G if an instruction of ADD 20 is given it will be split into:

ADD – ALU works out how to do an add20 – is where the data to be added will be found (the address)

• The address will be sent back to the MAR• Memory will be searched and whatever is in address ‘20’ will be copied

into the MDR.• The value in the MDR can then be used as per instructed by the CIR i.e

Adding• As the instruction is arithmetic it will be sent to the Accumulator (a

special storage register with the ALU) to be carried outTASK: Create a flow diagram of how a processor would handle this instruction through it’s registers.

Page 14: A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.

A-Level Computing#BristolMet

CPU & Registers

Indicate on the diagram below where the MAR and MDR would be positioned?