2. Blocks of a Microprocessor
2
Literal
Address
Operation
Program
Memory
Instruction
Register
STACK Program Counter
Instruction
Decoder
Timing, Control and Register selection
Accumulator
RAM &
Data
Registers
ALU
IO
IO
FLAG &
Special
Function
Registers
Clock
Reset
Interrupts
Program Execution Section Register Processing Section
Set up
Set up
Modify
Address
Internal data bus
Source: Makis Malliris & Sabir Ghauri, UWE
3. Combinational Circuits
Binary values of outputs are a function of binary
combination of inputs
Outputs at any given time are entirely dependent
on inputs that are present at that time
3
Combinational
Circuits
n inputs m outputs
4. Adding 2 Numbers
Write the truth table for addition of 2 bits A & B
Write Boolean representation for Sum & Carry
S = A/B + AB/ = A B
C = AB
4
A B Sum (S) Carry (C)
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
5. Adding 2 Numbers (Cont.)
Draw logic circuit
This is called a half adder
5
Source: Wikipedia.org
6. Adding 2 Numbers & a Carry
Write the truth table for addition of 2 bits A & B
as well as a carry from previous low-order bit
6
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
7. Adding 2 Numbers & a Carry (Cont.)
Write Boolean representation for Sum & Carry
Hint – use k-maps
S = (A B) Cin
Cout = AB + (A B)Cin
7
ab
c
00
01
11
10
0 1
1
0
1
0
0
1
0
1
ab
c
00
01
11
10
0 1
0
1
1
1
0
0
1
0
S = Cout =
8. Adding 2 Numbers & a Carry (Cont.)
Draw logic circuit
This is called a full adder
8
Source: www.setupsolution.com/how-to-design-a-half-adder-and-full-adder-in-verilog-at-gate-level-modeling/
11. Decoders
Suppose a simple microprocessor supports
following 2 instructions
ADD
LOAD
When these instructions execute they’ll need to
activate different circuits
Which circuit is determined by 2 most significant bits
11
12. Decoders
Converts binary data from n coded inputs to a
maximum of 2n unique outputs
Called n-to-2n decoder
12
Decoder
b0
b1
Adder
Loader
d0
d1
d2
d3
24. Multiplexer
Receives binary data from 2n lines & connect
them to a single output line based on a selection
By applying a control signals we can steer any
input to the output
24
Multipl-
exer
d0
d1
s0 s1
q
d2
d3
29. Demultiplexer
Reverse process of a multiplexer
By applying a control signals we can steer the
input signal to one of the output lines
29
Demult-
iplexer
q0
q1
s0 s1
d
q2
q3
30. Demultiplexer (Cont.)
Truth table
Logic circuit
30
s0 s1 q0 q1 q2 q3
0 0 d
0 1 d
1 0 d
1 1 d
d
q0
q1
q2
q3
s0 s1Source: http://do-area.blogspot.com/p/multiplexer-demultiplexer.html