Professional Documents
Culture Documents
computer architecture and organization
computer architecture and organization
Contacts:
e-mail: jmssemwogerere@gmail.com
jssemwogerere@vu.ac.ug
Lecture Hours
Tuesdays: 8:00a.m. – 11:00 a.m. (online/physical)
11:00a.m. – 2:00 p.m. (online/physical)
2:00p.m. – 5:00 p.m. (online/physical)
His machines were used for the 1890 census and the
data that would have been processed in ten years was
processed in only one year.
John Atanasoff
He built a machine that used binary arithmetic and had
capacitors for memory which were periodically refreshed to keep
the charge from leaking (jogging memory). Modern dynamic RAM
chips work in the same way.
Howard Aiken
He improved on Babbage’s machine by building it on relays. His
machine was called the Havard Mark I.
THE COMPUTER EVOLUTION
Summary of the Mechanical Era
The mechanical computers were designed to reduce
the time taken for calculating and to increase on the
accuracy of the results. They however had two draw
backs:
COLOSSUS
It was built in 1945 by Alan Turing to decode
encrypted messages sent by the Germans’ ENIGMA
whose decoding involved a lot of computations.
The von Neumann machine had five basic parts: memory, the
arithmetic–logic unit, the program control unit, the input and the output.
The 701
Built by IBM in 1953. It had 2K of 36 bit words with two
instructions per word. The 704 followed in 1956 with
4K core of memory, 36 bit instructions and floating
point hardware.
THE COMPUTER EVOLUTION
Generation 2 ---Transistors (1955 – 1965)
The transistor was invented at Bell labs in 1948. The first
transistorized computer built at M.I.T. was a 16 bit machine. It
was called the TX-0 (Transistorized eXperimental Computer 0).
The PDP–1
It was manufactured by DEC in 1961. It had 4K of 18 bit words
and a cycle time of 5 microsec. It cost $120,000.
PDP-8
by DEC followed later. It was a 12 bit machine but cheaper,
$16,000. It had a single bus, the omnibus.
THE COMPUTER EVOLUTION
IBM built a transistorized 7090 which was twice as
faster as the PDP-1 but it cost millions of dollars. They
later built the 7094 which had a cycle time of 2 micro
sec and 32K of 36 bit words of core memory.
CDC built the 6600 in 1964 which was faster than the
7094. It was a highly parallel machine within the CPU
and could execute 10 instructions at once.
Summary
Transistors, High level languages, Floating Point
Arithmetic.
THE COMPUTER EVOLUTION
Generation 3 ---Integrated Circuits (1965 – 1980)
IC’s allowed dozens of transistors to be put on a single chip.
Smaller, faster and cheaper machines could now be built.
The 360 series was followed by the 370 series, 4300 series and
the 3069 series.
Input Data
Output Data
Process data
Store data
Memory
The microprocessor (CPU)
Decodes instructions and use them to control
the activities within the system
Memory
Stores both data and instructions that are
currently being used.
I/O Subsystem:
Moves data between the computer and external
environment. It consists of devices for :
Communicating with the external world (I/O
Devices)
System Bus.
A set of conductors that connect the CPU to its
memory and I/O devices. The bus conductors are
normally separated into 3 groups:
The Data Lines: for transmitting information
Address Lines: Indicate where information is to
come from or where it is to be placed.
Control Lines: To regulate the activities on the bus.
Interfaces
Circuitry needed to connect the bus to a device.
Memory interfaces
Decode the address of the memory location being
accessed.
Buffer data onto/off the bus.
Contain circuitry to perform memory reads or write.
I/O interfaces
Buffer data onto/off the system bus
Receive commands from the CPU
Transmit information from their devices to the CPU.
COMPUTER STRUCTURE
Two arrangements of these components can be
described:
The Single bus / Single processor
architecture: one processing element and all
the other components are connected to a single
link (the System Bus)
Single Bus / Single Processor
Multiprocessing System
2. Alphanumeric Codes:
Store both numbers and characters including the
alphabetic characters.
NUMERIC FORMATS
Integer Formats
Binary:
To convert from decimal to binary we do successive
divisions
OCTAL
• Each octal digit can be represented by a unique combination
of three bits.
e.g. 1100110112 = 110 011 0112 = 6338
.6875 * 2 = 1.375
.375 * 2 = 0. 75
.75 * 2 = 1.5
.5 * 2 = 1.0
Overflows
If the result of any operation does not fit into the
number of bits reserved for it an overflow is said to
occur.
-5 + -7 = 10000101
- 10000111
10001100 (-12)
COMPLEMENTS
The 4 digit 10’s complement of X is defined as
104 – X
COMPLEMENTS
0557 + - 725 => 104 – 725 = 9275 => 0557
+9275 = 9832
If N + 1 bits are reserved for the exponent and the sign, the offset or
bias chosen = 2N and the format is called the excess 2N format
In excess 128 format, the number 01111110 = 126 implies that the
exponent = -2.
Example 1
–13.6875 = - 1101.10112 = - 0.11011011 * 24
Exponent in excess 128 = 128 + 4 = 132 = 100001002
Sign of the fraction is negative => 1
It has 2 forms; the single precision and the double precision format
where N = 127 and 1023 respectively.
Sign of Base 2 exponent magnitude of fraction
fraction in excess of 127
- 1 bit-> --------8 bits--------------------------------23 bits---------------------------
• Hardware designed for BCD is more complex than that for binary
formats. E.g. 16 bits are used to write 8159 in BCD while only 13
bits (1111111011111) would be required in binary.
The adjustment rule is: If the sum of 2 digits is > 9, add 6 to the sum.
1748 0001 0111 0100 1000
+ 2925 0010 1001 0010 0101
4673 0100 0000 0111 1101
0110 0110
0100 0110 0111 0011
ALPHANUMERIC CODES
• Infix notation: uses parentheses and the operators are placed between their operands.
• The postfix or reverse Polish Notation places operators after the operands.
e.g.
INFIX POSTFIX
A/(B + C) ABC+/
(A + B) * [C * (D + E) + F] AB+CDE+*F+*
f * (g + h)
Any variable that can take on two states e.g. (0, 1, True,
false; on/off) is called a logical variable.
A circuit whose inputs and outputs are described by
logical variables is called a logical network.
INPUTS OUTPUTS
Logical Variables Logical Variables
Logical Networks
There are two types of logical networks:
Combinatorial networks: Their outputs depend on
the current inputs.
Input Output
A
AB A B AB
0 0 0
B
0 1 0
1 0 0
1 1 1
AB 0 0 1
B 0 1 1
1 0 1
The output is 0 if all the inputs are 1’s.
1 1 0
A B A+B
A A+B
0 0 1
B
0 1 0
The output is 1 if all the inputs are 0’s. 1 0 0
1 1 0
LOGIC GATES
6. The EXCLUSIVE OR Gate
A B A+B
A A+B 0 0 0
B 0 1 1
1 0 1
A B A+B
7. The EXCLUSIVE NOR Gate
0 0 1
0 1 0
A A+B
1 0 0
B 1 1 1
Complex Logic gates
Logic circuits can be built by combining several of the elementary
logic gates.
A graphical illustration of a logic circuit is called a logical diagram
A
C
AC + BC
B
A
B (A + B)C
C
• The best way to prove equivalence is to use the truth tables
EXAMPLE
To prove that AC + BC = (A + B)C
A B C B AC BC AC + BC A+B (A + B)C
0 0 0 1 0 0 0 1 0
0 0 1 1 0 1 1 1 1
0 1 0 0 0 0 0 0 0
0 1 1 0 0 0 0 0 0
1 0 0 1 0 0 0 1 0
1 0 1 1 1 1 1 1 1
1 1 0 0 0 0 0 1 0
1 1 1 0 1 0 1 1 1
EXAMPLE
B
C
D
E
F
G
A B C X
0 0 0 0 X0
0 0 1 0 X1
0 1 0 0 X2
0 1 1 1 X3
1 0 0 0 X4
1 0 1 1 X5
1 1 0 1 X6
1 1 1 1 X7
Boolean expression
Step 2 (Find the Boolean expression.)
X0 = A + B + C; X1 = A + B + C; X2 = A + B + C; X4 = A + B + C
X = X0X1X2X4 = ( A + B +C)(A + B + C) (A + B + C) (A + B + C)
AC BC+AC+AB BC+AC+AB
AC
AB
MAXITERMS & MINITERMS
• The occurrence of a variable or its complement in an expression is called a literal.
• A term in the SUM OF PRODUCTS that includes a literal for every input is called a
miniterm.
• A term in the PRODUCT OF SUMS that includes a literal for every input is called a
maxiterm.
_ _ _ _ _ _
• e.g. in ABC + ABC + AC; ABC and ABC are miniterms, AC is not a miniterm.
_ _ _ _ _ _ _ _ _
• Similarly in (A +B+C)(A+B+C)(A+C), (A +B+C) and (A+B+C) are
_
• maxiterms, (A+C) is not.
KARNAUGH MAPS
• A Karnaugh map is a truth table for a single output
consisting of arrays of squares where each square
corresponds to a row of a truth table.
• The symbols at the top represent the variables
associated with the columns and the symbols on the left
represent the variables associated with the rows.
• The value of each output for each input is put in the
corresponding square.
• For each 1 in the Karnaugh map there is a
corresponding miniterm in the output’s Sum of product
expression and each 0 represents a maxiterm in the
Product of Sums expression.
EXAMPLES
Two inputs Three Inputs
A AB
0 1 00 01 11 10
B 0 0 2 C
0 0 2 6 4
1 1 3
1 1 3 7 5
Four Inputs
AB
00 01 11 10
00 0 4 12 8
CD
01 1 5 13 9
11 3 7 15 11
10 2 6 14 10
EXAMPLE 1
A B C X Using Boolean Algebra
0 0 0 0
X = ABC + ABC + ABC
0 0 1 0
= ABC + ABC + ABC + ABC
0 1 0 0
= BC + AB
0 1 1 1
Look for adjacent groups that
1 0 0 0
include 2n miniterms where n is
1 0 1 0 an integer. The larger the group
1 1 0 1 the greater is the reduction. A
1 1 1 1 B
AB B
00 01 11 10 C
C 0 0 0 1 0
EXAMPLE2
A B C X
Using Boolean simplification:
0 0 0 0
ABC + ABC + ABC + ABC
0 0 1 0
ABC + ABC + ABC + ABC ABC + ABC
0 1 0 0
= BC + AC + AB
0 1 1 1
AB
1 0 0 0
00 01 11 10
1 0 1 1
C 0 0 0 1 0
A
1 1 0 1 B
1 0 1 1 1 AC
1 1 1 1 B
C
A function may be used to state where the
output is 1 instead of drawing a Karnaugh
EXAMPLE 3
F(A,B,C) = (0,1,2,3,7)
AB
00 01 11 10
0 1 1
A
C
1 1 1 1
B
C
More Examples
AB
00 01 11 10
0 1 1 1 A
C C
1 1 1
B
AB
00 01 11 10
C 0 1 1 B
1 1
C
AB
More Examples
AB
AB
00 01 11 10
00 01 11 10 BD
AB 00 1 1
00 1 1 1
01 1
01 1 1
CD 11 1 1
CD11 1
10 1 1
10 1
ABC ACD AB BC
THE DON’T CARE CASES
• For some designs some input combinations cannot occur. Their
outputs are represented by X’s in the Karnaugh Map and they may
or may not be included in the prime implicants.
• They are called Don’t Care Cases denoted by the function d(A,B,C) =
(….)
AB
00 01 11 10
00 X
CD 01 1
11 1 AB
10 X 1 1
ACD
C = AB
A B S = AB + AB = A + B
A
+ B A B
Carry Sum
C H
A
A B S
S C
0 0 0 0
0 1 1 0
C S
1 0 1 0
1 1 0 1
Full Adder
It is an adder that includes a carry input
from a lower
A
order
B
sum. A B Ci S CO
0 0 0 0 0
0 0 1 1 0
FA Ci 0 1 0 1 0
Co 0 1 1 0 1
S 1 0 0 1 0
CI
CO S
Ripple Carry Adder
It is a circuit built up of may full adders consisting of the
required number of bits. The carry out bit is used as a
carry in into its left neighbour. The carry into the right
most bit is set to 0.
A Multiplexer (Data Selector)
• It is a logical network capable of selecting a single set of
data inputs from a number of sets of inputs and it passes
the selected inputs to the outputs.
• A multiplexer has 2 kinds of inputs, the control inputs and
the data inputs.
• The control inputs are used to select which of the inputs in
the data is to be passed through to the outputs.
A0 An
Control MUX(n)
Output
2-1 Multiplexer
It has 2 data inputs A and B, one control input , P, and one output, X.
When the control input P = 0 the output X is A and when P = 1 X = B
P A B X
X = PAB + PAB + PAB + PAB
0 0 0 0 = PA(B + B) + PB(A + A)
0 0 1 0 = PA + PB
0 1 0 1 A B
0 1 1 1
P
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
X
4-1 Multiplexer
It selects only one of the 4 inputs. It has 2 control lines to choose one of
the 4 possible inputs.
A B C D
P
X
In general for an n to 1 multiplexer, the inequality 2K >= n must be satisfied
A Demultiplexer
It has 1 set of data inputs and two or more sets of outputs and a set of
control inputs whose purpose is to select the set of outputs to transmit.
The other outputs are 0.
Inputs
Control DMUX(n)
Outputs
A 1- 2 Demultiplexer
It has 1 data input (A) , two outputs( X, Y)
and one control input (P) .
A
X= PA; Y= PA
P DMUX(n) A
P
X Y
P A X Y
0 0 0 0
0 1 1 0
X Y
1 0 0 0
1 1 0 1
Comparators
Inputs
A B
output
The equality comparator
B2B1B0 = A2A1A0
A2 B2 A 1 B1 A 0 B0
1 bit > comparator
The output is 1 if A > B
X = AB
A B X
0 0 0 A B
0 1 0
1 0 1
1 1 0
X
Decoder
Circuit whose outputs are miniterms of the inputs. Exactly only one
output is a 1 at any given time.
If n is the number of inputs and m the number of outputs then 2n >=
m
e.g. if the binary number on the input lines is k then output line k will
be 1 and all the others will be 0’s.
A1 A 2 A3 X0 X1 X2 X3 X4 X5 X6 X7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Decoder
A3
A2
A1
X0 X1 X2 X3 X4 X5 X6 X7
The Encoder
Inputs Outputs
A1 A2 A3 A4 A5 X1 X2 X3
1 0 0 0 0 0 0 1
0 1 0 0 0 0 1 0
0 0 1 0 0 0 1 1
0 0 0 1 0 1 0 0
0 0 0 0 1 1 0 1
X3 = A1 + A3 + A5 X2 = A2 + A3 X1 = A4 + A5
Encoder
X3 = A1 + A3 + A5 X2 = A2 + A3 X1 = A4 + A5
A1
A2
A3
A4
A5
Code Converters
They are electronic circuits whose purpose is to convert data from one format to another.
Data in a computer system may take on several different forms as it changes from one format to
another.
e.g. the decimal input from a keyboard calculator must be converted into BCD using an encoder.
The CPU’s output is in BCD and the decoder translates the BCD to a special 7 segment display code by a
decoder.
7 8 9
1 2 3
0 Decimal
Display
The encoder circuit
The encoder has 10 active inputs and 4 outputs connected to input lamps.
e.g. The input 7 causes a BCD output of 0111.
9 23 22 21 20
9
8 8 A
7 7 DECIMAL
6 6 TO
5 BCD ENCODER B
5 4
4 3 C
3 2
2 1 D
1 0
0
The Decoder circuit
0 A a a
b b
1 B c c
Decoder d d
1 C e e Display
f f
1 D g g
The Display
a
f b
e c
d
A B C D a b c d e f g
0 0 0 0 1 1 1 1 1 1 0
0 0 0 1 0 1 1 0 0 0 0
0 0 1 0 1 1 0 1 1 0 1
0 0 1 1 1 1 1 1 0 0 1
0 1 0 0 0 1 1 0 0 1 1
0 1 0 1 1 0 1 1 0 1 1
0 1 1 0 0 0 1 1 1 1 1
0 1 1 1 1 1 1 0 0 0 0
1 0 0 0 1 1 1 1 1 1 1
ROMS AND PLA’S
ROM (Read Only Memory)
• Its circuit is equivalent to a decoder. It outputs all possible
miniterms of the inputs followed by an encoder.
• The output combinations are permanently embedded in its
circuitry and the inputs serve to select one of these
combinations. Each output is obtained by disconnecting the OR
inputs from the AND gates whose miniterms are not to be
included in the output.
• Because a ROM must produce all the possible miniterms its
decoder portion is fixed by n (the number of inputs). The
encoder portion depends on both the outputs and the way in
which all the outputs of a decoder are used to generate the
final ROM outputs.
ROMS
A1 X1
DECODER 2n miniterms ENCODER
An Xn
EXAMPLE
Construct a 2 input ( A,B) and 3 output (X,Y,Z) ROM such that:
X = AB + AB; Y = AB + AB; Z = AB + AB
ROM EXAMPLE
A These
connections
are always
B made
AB AB AB AB
These are
selectively
made
X Y Z
PLA (Programmed Logic Array)
• Similar to a ROM but does not output miniterms that
will not be needed in any of the outputs. i.e. the
decoder does not necessarily produce all the
miniterms. For an n input network, we have <= 2n
AND gates
A1 X1
DECODER < 2n miniterms ENCODER
An Xn
EXAMPLE
Implementation of the above ROM as a PLA
PLA example
A
B
Both sets of
connections are
AB AB AB made selectively
X Y Z
PARITY GENERATION AND DETECTION
Parity bit
Data Bits
Error Detection
1 if there is an error
0 if no error
Parity Bit
Data Bits
Sequential Networks
SEQUENTIAL LOGIC & COMPUTER CIRCUITS
• Examples
A simple counting device; its output depends on the input
signal that causes the output to increment and also on the
current count that was previously determined.
Increasing time
period
Monostable multivibrators
They can take on two states but are stable in only one
of them. They can only temporarily stay in the unstable
state.
Bistable
They are stable in either of the 2 states and can
therefore maintain either state indefinetely.
FLIP FLOPS
They are bistable devices that are used in sequential networks.
The most common flip-flops are the R-S, J-K, T, and the D flip flop.
S Q
Q
R
S R Q+ Q+ Q
0 0 Q- Q- S
0 1 0 1 C FF Q
1 0 1 0 R
THE R-S FLIP -FLOP
It has 3 inputs S(Set), R (Reset) and C (a clock input)
which synchronizes the action of the flip-flop with its
surrounding
Q
Q
It has the same behaviour like the R-S flip flop except
that the C = J = K = 1 combination is meaningful and the
results in the output states is reversed.
J S Q
C
C R Q
K
J Q
C FF
K Q
J K Q+ Q+
0 0 Q- Q-
0 1 0 1
1 0 1 0
1 1 Q- Q-
T Flip-Flop
S FF Q T FF Q
C C Q
R Q
T Q+ Q+
0 Q- Q-
1 Q- Q-
• It has only one input.
• Its output states are reversed each time the input is pulsed.
• It is used in the design of counters.
• A T flip flop can be obtained from a J-K flip flop by permanently
applying 1’s to the J and K inputs. The R-S flip flop must be edge
triggered.
D FLIP FLOP
D
D S FF FF
Q C
C C
Q D Q+ Q+
R 0 0 1
1 1 0
It has 2 inputs, a clock input and an input labelled D such that the Q
output is equal to the D input whenever the clock input is set to 1;
otherwise it is not affected by the D input.
Q
Latch
Q
Positive edge triggered
Q
Negative edge triggered
Clear and Preset Inputs
• Flip flops can clear or set the Q output irrespective of the state of
the other inputs. The clear input clears Q and the Preset input sets
Q
D J Preset
FF
C
C
K
clear clear
REGISTERS
D Q D Q D Q D Q
C Q C Q C Q C Q
Load
Read
Registers
The common clock load permits new information to be
loaded.
If one bit is sent one after the other over 1 signal path, this
is called Serial Data transmission.
Data Transmission
In parallel transmission, some extra control
lines are used by the transmitting device to
signal to the receiving device when data is
ready to be read and the receiving device to
signal to the transmitting device that the data
has been read.
0 1 0 1 0 0 0 1 0
Start bit Stop bit
Disadvantages
More wires (or communication channels) are needed.
D0 D1 D2 D3
Serial
Input D Q D Q D Q D Q
Clock
C Q C Q C Q C Q
Clear Clear Clear Clear
Reset
• Each clock pulse loads a data bit until the register is full. After the 4 bit
character is loaded it can be read from the parallel output lines D 0 – D3
Parallel To serial Converter
Parallel Input
D0 D1 D2 D3
0 J Q J Q J Q J Q serial
output
C C C C
Clock
Reset
• Once data is made available at D3 – D0 it can be loaded into the shift register by load
signal.
• The 4 clock pulses are used to cause the 4 bit character to appear sequentially at the
output
A Binary Counter
It is a circuit used to count and store the number of
pulses arriving at its input.
FF Q FF Q FF Q FF Q
Enable T T T T
Input
Clear Q Clear Q Clear Q Clear Q
Reset
Q0 (20) Q1 (21) Q2 (22 Q3 (23)
The carry out output is fed back into the carry in flipflop
so that it will provide the carry in for the next bit.
The flip flops must be reset to 0 and the lower order bits
must be received first.
Serial Adders and Subtractors
A1 A2
D Q D Q Q D
Reset
FA
Carry Carry
out in
S
Link Connections
Driver
Control
optional
IEEE standard tristate output symbol
Pull up Resistor
A
A+B
B
Sequential Network Design
The behaviour of a sequential circuit is
determined from the inputs, the outputs
and the state of the flip flops.
Example:
Outputs
X Y Z
S0 0 0 1
new S1 0 1 0
State S2 0 1 1
S3 1 0 0
S4 1 1 1
Sequential Network Design
10, 11
S0 00, 01 S1 01
0 0 1 00 0 1 0 00,01,11,10
S0 corresponds to Q = 0 S1 to Q = 1
10,11
00,01 S0 S1 00,10
0 01,11 1
Delays
Electronic circuits do not react instantaneously.
Sometimes delays are desirable such that if natural
delays are not enough special circuits called delay
devices are included in a design to create the required
delay.
The output of a delay device is the same as the input
except that the output occurs at a later time.
Microprocessor Architecture
The arrangement of registers in the CPU, number
of bits in the address and data buses etc
Instruction Set
Listing of operations the microprocessor can
perform
• Transferring data, Arithmetic and logical operations,
Data testing, Branching instructions, I/O operations
The CPU
Control Signals
Outputs that direct other IC’s e.g. ROMS and I/O
ports when to operate
Pin Functions
Details about special inputs and outputs of the
microprocessor.
Minimal System
how other devices are connected to the
microprocessor.
The CPU
The main structural components of the
CPU are:
Instruction Register
Bus
Control Arithmetic/Logic Unit
Unit
The CPU Registers
The Program Counter (PC)
Holds the address of the main memory
location from which the next instruction is
to be fetched
Instruction ?
Execute the
Conditional T Examine PSW Instruction
branch?
Arithmetic/Logic Unit
It performs arithmetic and logical operations on the
contents of the working registers, the PC, memory
locations etc.
Arithmetic Registers:
Temporarily hold the operands and the result of the
arithmetic operations
Address Registers:
for addressing data and instructions in main memory.
Little Endian
numbering of bits from right to left:
This is the numbering adopted by
Intel.
Classifications of memory
MASKED ROM:
Programmed by a masking operation while the chip is
being manufactured. They cannot be altered by the
user.
Static Ram:
keep its contents so long as power is on
Dynamic Ram:
made of capacitors that can be charged
or discharged. It must be refreshed
often because of charge leakage
I/O INTERFACES
Memory and peripherals are connected to buses
through interfaces and controllers.
A controller: initiates commands given to a
device and it senses the status of the
device.
Byte/Word Transfer
one byte or word is moved by one
command. e.g. a terminal.
Block Transfer
A whole block of information is moved
by a single command e.g. Direct
memory Access transfers which are
between memory and the peripheral
Data Transfer
In block transfers a device’s interface must be
used in conjunction with a DMA controller that
can access memory directly without intervention
by the CPU. e.g. a disk uses DMA.
B (8 bits) C (8 bits)
ALU D (8 bits) E (8 bits)
H ( 8 bits) L (8 bits)
The Intel 8085 Microprocessor
It is an 8 bit processor
1 8 bit accumulator.
1 16 bit stack pointer
1 16 bit program counter
The Intel 8085 Microprocessor
1 PSW with 5 flags.
Zero (Z)
Sign (S)
Parity (P)
Carry (C)
Auxiliary Carry (AC)
3. Reset Out:
Indicates that the CPU is being reset. It can be
used to reset other components in the system
6. TRAP
Causes a non-maskable interrupt. Input
remains high until sampled
21 – 28 A8 – A15
Address bus
32 RD Read
Memory or I/O read
The Intel 8085 Pin Assignment
29, 33, 34: S0, S1, IO/M: (output Control signals)
IO/M S1 S0 Status
0 0 1 Memory Write
0 1 0 Memory Read
0 1 1 Opcode Fetch
1 0 1 I/O Write
1 1 0 I/O Read
1 1 1 Interrupt
Acknowledge
* 0 0 Halt
* * * Hold/Reset
The Intel 8085 Pin Assignment
35 Ready:
Acknowledgement from memory or I/O device
that input data is available on the bus or
output data has been accepted
36. RESET IN
• Resets the CPU to its initial state.
• It is generated automatically when the
system is turned on.
• It clears the program counter to 0000H
• All maskable interrupts are disabled.
ALU
The Zilog (Z80) Microprocessor
8 bit processor
Parity (P)/Overflow
N = 1 during subtraction
13 control signals.
The Motorola MC 6809
Address Bus (16 lines) Data Bus (8lines) Control Bus (12 lines)
ALU
The Motorola MC 6809
It is an 8 bit processor i.e. has 8 data lines
Operand
Any address or piece of data that is
required by the instruction to complete
its execution
Register Codes
0 1 D D D S S S
0 1 0 0 0 1 1 1
1 0 0 0 0 S S S
1 0 0 1 0 S S S
0 0 D D D 0 1 0
The immediate data
0 0 1 1 1 0 1 0
0 0 0 0 1 1 0 0 The data
1 1 0 0 0 1 1 0
Immediate Data
1 1 0 1 0 1 1 0
Immediate Data
0 0 1 1 1 0 1 0 Opcode
Lower part of the address
Operand
Upper part of the address
(Address)
The instruction moves contents of a memory location
whose address is specified in the two bytes to the
accumulator.
More Examples
Store contents of the accumulator to memory
0 0 1 1 0 0 1 0 Opcode
Lower part of the address
Operand
Upper part of the address
(Address)
The instruction stores contents of the accumulator to
a memory location whose address is specified in the
given address.
Example
Conditional Branches
Opcode Condition Code
(if zero)
1 1 C C C 0 1 0
Lower part of the address
Higher part of the address
Immediate Addressing
Information is part of the instruction. They are usually
2 byte instructions where the operand is the second
byte.
Direct addressing
The address is part of the instruction.
ADDRESSING MODES
Base addressing:
The required address is calculated by adding the
contents of a memory location or register called a
base to a number called a displacement which is part
of the instruction.
Index Addressing
It is a process of incrementing or decrementing an
address as the computer sequences through a set of
consecutive or evenly spaced addresses. This is
done by successively changing an address that is
stored in a register called an index register that can
be incremented or decremented.
ADDRESSING MODES (Cont.)
Auto incrementing / decrementing
The index is automatically incremented by an
instruction.
Instruction Execution Time
The fetch cycle has 4 states and each of the other three
cycles has 3 states which makes a total of 13 states.
T1 T2 T3 T4 T1 T2 T3 T1 T2 T3 T1 T2 T3
Opcode fetch Read Read Write
memory Memory memory