Computer Architecture
and Organization
[CSE2003]
1
Dr. Ashfaq Ahmad
Faculty, SCSE,
VIT- Bhopal University.
Presentation by: Dr. Ashfaq Ahmad, Faculty, SCSE, VIT Bhopal University
2 Contents
UNIT – I: Introduction to Computer Architecture
Session – 3:
Organization of the Von Neumann machine
Interconnection of components
Introduction to Registers, RTL and register files
3 Session Objectives
After this session students will be able to:
Understand Organization of the Von Neumann
machine.
Understand Register and RTL
4 Von Neumann Model
MEMORY
MAR MDR
INPUT OUTPUT
Keyboard Monitor
Mouse PROCESSING UNIT Printer
Scanner LED
Disk ALU TEMP Disk
CONTROL UNIT
PC IR
4-4
5 The John von
Neumann
architecture
Showing Single Bus structure
6 Common Bus Organization
Showing Internal view of
Single Bus structure
Register Transfer & -operations
SIMPLE DIGITAL SYSTEMS
7
Combinational and sequential circuits can be used to create
simple digital systems.
These are the low-level building blocks of a digital computer.
Simple digital systems are frequently characterized in terms of
the registers they contain, and
the operations that they perform.
Typically,
What operations are performed on the data in the registers
What information is passed between registers
8 Concept behind Registers
A Flip-flop is also called a clock-controlled memory device.
A Flip-flop is used to store one bit of information. By connecting several Flip-flops
together, they may store data that can represent the state of a sequencer, the value of
a counter, an ASCII character in a computer’s memory or any other piece of
information.
9 Introduction to Register
Register is a very fast computer memory, used to store
data/instruction in-execution.
A Register is a group of flip-flops with each flip-flop capable of
storing one bit of information. An n-bit register has a group of n
flip-flops and is capable of storing binary information of n-bits.
A register consists of a group of flip-flops and gates. The flip-flops
hold the binary information and gates control when and how new
information is transferred into a register.
Various types of registers are available commercially. The
simplest register is one that consists of only flip-flops with no
external gates.
Classification of Registers (Common CPU
10
Registers
These are classified as given below.
Accumulator:
This is the most frequently used register used to store data taken from memory. It is in different
numbers in different microprocessors.
Memory Address Registers (MAR):
It holds the address of the location to be accessed from memory. MAR and MDR (Memory Data
Register) together facilitate the communication of the CPU and the main memory.
Memory Data Registers (MDR):
It contains data to be written into or to be read out from the addressed location.
General Purpose Registers:
These are numbered as R0, R1, R2….Rn, and used to store temporary data during any ongoing
operation. Its content can be accessed by assembly programming.
Program Counter (PC):
Program Counter (PC) is used to keep the track of execution of the program. It contains the memory
address of the next instruction to be fetched. PC points to the address of the next instruction to be
fetched from the main memory when the previous instruction has been successfully completed.
Program Counter (PC) also functions to count the number of instructions.
Instruction Register (IR):
It is the register which holds the instruction which is currently been executed.
Register Transfer & -operations
11
REGISTER TRANSFER AND MICROOPERATIONS
•Register Transfer:
The term register transfer means the availability of hardware logic circuits that can
perform a stated micro-operation and transfer the result of the operation to the same or
another register.
• Micro-operations
Register Transfer & -operations Register Transfer Language
MICROOPERATIONS (1)
12
The operations on the data in registers are called micro-
operations.
The functions built into registers are examples of micro-
operations
Shift
Load: The transfer of new information into a register is referred to as loading the
register.
Clear
Increment
…
Register Transfer & -operations Register Transfer Language
MICROOPERATION (2)
13
An elementary operation performed (during
one clock pulse), on the information stored
in one or more registers
Registers ALU 1 clock cycle
(R) (f)
R f(R, R)
f: shift, load, clear, increment, add, subtract, complement,
and, or, xor, …
Register Transfer & -operations Register Transfer Language
REGISTER TRANSFER LEVEL
14
Viewing a computer, or any digital system, in this way is called the register
transfer level
This is because we’re focusing on
The system’s registers
The data transformations in them, and
The data transfers between them.
Register Transfer & -operations Register Transfer Language
REGISTER TRANSFER LANGUAGE
15
Rather than specifying a digital system in words, a specific notation is used, register transfer
language
For any function of the computer, the register transfer language can be used to describe the
(sequence of) micro-operations
Register Transfer Language (RTL)
The symbolic notation used to describe the micro-operation transfers amongst registers is called Register
transfer language.
OR
Register Transfer Language
A symbolic language
A convenient tool for describing the internal organization of digital computers
Can also be used to facilitate the design process of digital systems.
Register Transfer & -operations Register Transfer Language
DESIGNATION OF REGISTERS
16
Registers are designated by capital letters, sometimes followed by numbers (e.g., A, R13, IR)
Often the names indicate function:
MAR - memory address register
PC - program counter
IR - instruction register
Registers and their contents can be viewed and represented in various ways
A register can be viewed as a single entity:
MAR
Registers may also be represented showing the bits of data they contain
Register Transfer & -operations Register Transfer Language
DESIGNATION OF REGISTERS
17
• Designation of a register
- a register
- portion of a register
- a bit of a register
• Common ways of drawing the block diagram of a register
Register Showing individual bits
R1 7 6 5 4 3 2 1 0
15 8 7 0
15 0 PC(H) PC(L)
Numbering of bits
Subfields
R2
Register Transfer & -operations Register Transfer
REGISTER TRANSFER
18
Copying the contents of one register to another is a register transfer
A register transfer is indicated as
R2 R1
In this case the contents of register R1 are copied (loaded) into register
R2
A simultaneous transfer of all bits from the source R1 to the
destination register R2, during one clock pulse
Note that this is a non-destructive; i.e. the contents of R1 are not
altered by copying (loading) them to R2
Register Transfer & -operations Register Transfer
REGISTER TRANSFER
19
A register transfer such as
R3 R5
Implies that the digital system has
the data lines from the source register (R5) to the destination register (R3)
Parallel load in the destination register (R3)
Control lines to perform the action
Register Transfer & -operations Register Transfer
CONTROL FUNCTIONS
20
Often actions need to only occur if a certain condition is true
This is similar to an “if” statement in a programming language
In digital systems, this is often done via a control signal, called a control
function
If the signal is 1, the action takes place
This is represented as:
P: R2 R1
Which means “if P = 1, then load the contents of register R1 into register R2”, i.e.,
if (P = 1) then (R2 R1)
Register Transfer & -operations Register Transfer
HARDWARE IMPLEMENTATION OF CONTROLLED TRANSFERS
21
Implementation of controlled transfer
P: R2 R1
Block diagram Control P Load
R2 Clock
Circuit
n
R1
Timing diagram t t+1
Clock
Load
Transfer occurs here
• The same clock controls the circuits that generate the control
function
and the destination register
• Registers are assumed to use positive-edge-triggered flip-flops
Register Transfer & -operations Register Transfer
SIMULTANEOUS OPERATIONS
22
If two or more operations are to occur simultaneously, they are separated
with commas
P: R3 R5, MAR IR
Here, if the control function P = 1, load the contents of R5 into R3, and at
the same time (clock), load the contents of register IR into register MAR
LOGIC MICRO-OPERATIONS
P: R1 R1 Ф R2
Register Transfer & -operations Register Transfer
BASIC SYMBOLS FOR REGISTER TRANSFERS
23
Symbols Description Examples
Capital letters Denotes a register MAR, R2
& numerals
Parentheses () Denotes a part of a register R2(0-7), R2(L)
Arrow Denotes transfer of information R2 R1
Colon : Denotes termination of control function P:
Comma , Separates two micro-operations A B, B A
24
25 RTL questions
1. Following is the list of register transfer micro-operations. They are originally written so that
they can be executed from top to bottom in sequential order.
R2 R1
R3 R5
R4 R1
R1 R5
R5 R6
Suppose each register is connected to single three state bus via bi-directional I/O lines. Execute
above 5 operations in no more than 3 cycles.
ANSWER:
R2 R1; R4 R1
R3 R5; R1 R5
R5 R6
26
2. Represent the following conditional control statement by two register transfer
statements with control functions.
If (P = 1) then (R1 R2) else if (Q = 1) then (R1 R3)
Answer:
P: R1 R2
P’Q: R1 R3
Basic Computer Organization & Design
THE BASIC COMPUTER
27
The Basic Computer has two components, a processor and memory
The memory has 4096 words in it
4096 = 212, so it takes 12 bits to select a word in memory
Each word is 16 bits long
CPU RAM
0
15 0
4095
Basic Computer Organization & Design Instruction codes
INSTRUCTIONS
28
Program
A sequence of (machine) instructions
(Machine) Instruction
A group of bits that tell the computer to perform a specific operation (a sequence of micro-operation)
The instructions of a program, along with any needed data are stored in memory
The CPU reads the next instruction from memory
It is placed in an Instruction Register (IR)
Control circuitry in control unit then translates the instruction into the sequence of
microoperations necessary to implement it
Basic Computer Organization & Design Instruction codes
INSTRUCTION FORMAT
29
A computer instruction is often divided into two parts
An opcode (Operation Code) that specifies the operation for that instruction
An address that specifies the registers and/or locations in memory to use for that operation
In the Basic Computer, since the memory contains 4096 (= 212) words, we needs 12 bit
to specify which memory address this instruction will use
In the Basic Computer, bit 15 of the instruction specifies the addressing mode (0: direct
addressing, 1: indirect addressing)
Since the memory words, and hence the instructions, are 16 bits long, that leaves 3 bits
for the instruction’s opcode
Instruction Format
15 14 12 11 0
I Opcode Address
Addressing
mode
Basic Computer Organization & Design Instruction codes
ADDRESSING MODES
The
30 address field of an instruction can represent either
Direct address: the address in memory of the data to use (the address of the operand), or
Indirect address: the address in memory of the address in memory of the data to use
Direct addressing Indirect addressing
22 0 ADD 457 35 1 ADD 300
300 1350
457 Operand
1350 Operand
+ +
AC AC
Effective Address (EA)
The address, that can be directly used without modification to access an operand for a computation-type instruction,
or as the target address for a branch-type instruction
Basic Computer Organization & Design Instruction codes
PROCESSOR REGISTERS
31
A processor has many registers to hold instructions, addresses, data, etc
The processor has a register, the Program Counter (PC) that holds the memory address of
the next instruction to get
Since the memory in the Basic Computer only has 4096 locations, the PC only needs 12 bits
In a direct or indirect addressing, the processor needs to keep track of what locations in
memory it is addressing: The Address Register (AR) is used for this
The AR is a 12 bit register in the Basic Computer
When an operand is found, using either direct or indirect addressing, it is placed in the
Data Register (DR). The processor then uses this value as data for its operation
The Basic Computer has a single general purpose register – the Accumulator (AC)
Basic Computer Organization & Design Instruction codes
PROCESSOR REGISTERS
32
The significance of a general purpose register is that it can be referred to in instructions
e.g. load AC with the contents of a specific memory location; store the contents of AC into a specified memory
location
Often a processor will need a scratch register to store intermediate results or other temporary
data; in the Basic Computer this is the Temporary Register (TR)
The Basic Computer uses a very simple model of input/output (I/O) operations
Input devices are considered to send 8 bits of character data to the processor
The processor can send 8 bits of character data to output devices
The Input Register (INPR) holds an 8 bit character gotten from an input device
The Output Register (OUTR) holds an 8 bit character to be send to an output device
Basic Computer Organization & Design Registers
BASIC COMPUTER REGISTERS
33
Registers in the Basic Computer
11 0
PC
Memory
11 0 4096 x 16
AR
15 0
IR CPU
15 0 15 0
TR DR
7 0 7 0 15 0
OUTR INPR AC
List of BC Registers
DR 16 Data Register Holds memory operand
AR 12 Address Register Holds address for memory
AC 16 Accumulator Processor register: Results of operations go to this register
IR 16 Instruction Register Holds instruction code
PC 12 Program Counter Holds address of instruction
TR 16 Temporary Register Holds temporary data
INPR 8 Input Register Holds input character
OUTR 8 Output Register Holds output character
Basic Computer Organization & Design Registers
COMMON BUS SYSTEM
34
The registers in the Basic Computer are connected using a bus
This gives a savings in circuitry over complete connections between registers
35 Bus Transfers
A digital system composed of many registers, and paths must be provided to transfer
information from one register to another. The number of wires connecting all of the
registers will be excessive if separate lines are used between each register and all other
registers in the system.
A bus structure, on the other hand, is more efficient for transferring information between
registers in a multi-register configuration system.
A bus consists of a set of common lines, one for each bit of register, through which binary
information is transferred one at a time. Control signals determine which register is
selected by the bus during a particular register transfer.
The following block diagram shows a Bus system for four registers. It is constructed with
the help of four 4 * 1 Multiplexers each having four data inputs (0 through 3) and two
selection inputs (S1 and S2).
36 Contd..
Labels are used to make it more convenient for you to understand the input-output
configuration of a Bus system for four registers. For instance, output 1 of register A is
connected to input 0 of MUX1.
The following function table shows the register that is selected by the bus for each of the
four possible binary values of the Selection lines.
37 Contd..
38
Common bus system of basic computer
▪ Common bus
20
39 Computer Architecture
Computer Architecture concerns Machine Organization,
interfaces, application, technology, measurement & simulation
that Includes:
Instruction set
Data formats
Principle of Operation (formal description of every operation)
Features (organization of programmable storage, registers
used, interrupts mechanism, etc.)
In short, it is the combination of Instruction Set Architecture,
Machine Organization and the related hardware.