Computer Architecture
Computer Architecture
For a three-variable expression, the minterms and maxterms are
as follows
X Y Z Minterm Maxterm
0 0 0 X'.Y'.Z' X+Y+Z
0 0 1 X'.Y'.Z X+Y+Z'
0 1 0 X'.Y.Z' X+Y'+Z
0 1 1 X'.Y.Z X+Y'+Z'
1 0 0 X.Y'.Z' X'+Y+Z
1 0 1 X.Y'.Z X'+Y+Z'
1 1 0 X.Y.Z' X'+Y'+Z
1 1 1 X.Y.Z X'+Y'+Z'
Pasted from <http://www.asic-world.com/digital/boolean2.html>
If a function is expressed as a product or sum of … is said to be in canonocal form
o Express any function as a sum of minterms
F=A+B'C
Consider term A, its missing B and C to be a minterm
A = A(B'+B)
…
(AB'+AB)(C+C')
…
o Express as a function of minterms
Use distributive law x+yz=(x+y)(x+z)
Add +x'x if needed, because anything + 0 = 0 anything
o If asked to find ' of a function, pick the remaining min/maxterms
K maps
o The function for this is F= x’y + xy’ + x’y’
o
x\y 0 1
0 1 1
1 1 0
o Adjacent squares differ by one variable
You can simplify this kmap
Combine m0 and m1
x’y’ + x’y => x’( y + y’) = x’
Combine m0 and m2
x’y’ + xy’ => y’( x + x’) = y’
F = x’ + y’
o 3 variable kmap
o
Y0z0 Y0z1 Y1z1 y1z0
x0 m0 m1 m3 m2
x1 m4 m5 m7 m6
You can find out how to simply the equation by looking at adjacent blocks that don't
change
o F(x,y,z) = Σ(2,3,4,5)
y'yz'+x'yz+xy'z'+xy'z
Put a 1 in the k map for the m(n) corresponding to Σ(n)
o
x\yx Y0z0 Y0z1 Y1z1 y1z0
x0 m0 m1 1 m3 1 m2
x1 1 m4 1 m5 m7 m6
o m2 and m3
X is always 0 Y is always 1, drop the z
=x'y
o m4 and m5
X is always 1 and y is always 0, drop the z
Xy'
o Final function is only F=x'y+xy'
F(x,y,z) = Σ(3,4,6,7)
o
x\yx Y0z0 Y0z1 Y1z1 y1z0
x0 m0 m1 1 m3 m2
x1 1 m4 m5 1 m7 1 m6
o You have a choice for simplification here
You can combine m4 and m6 because kmaps are cylinders
Drop the y
xz'
Combine m3 and m7
Drop the x
yz
You can reuse an m(n) box when simplifying
o Final F=xz'+yz
Four variable
o
wx\yx Y0z0 Y0z1 Y1z1 y1z0
w0x0 m0 m1 m3 m2
w0x1 m4 m5 m7 m6
0 0 0 0
1 1 1 1
2 2 2 10
3 3 3 11
4 4 4 100
5 5 5 101
6 6 6 110
7 7 7 111
8 8 10 1000
9 9 11 1001
10 A 12 1010
11 B 13 1011
12 C 14 1100
13 D 15 1101
14 E 16 1110
15 F 17 1111
Storing and remembering things: synchronous sequential logic
Has a storage element
Affected by a signal
Clock pulse
Storage element affected by clock pulse
Memory elements
Time delayed devices
Master clock generator
Generates periodic clock pulses
Memory elements affected at clock pulses
Clocked sequential circuits
Memory elements (flip flops)
Store 1 bit of information
Flip flop
D flip flop eliminates indeterminate states ensures R& S are never 1
Set, Reset, Clock pulse (if =0, nothing happens, only changes when it goes 0 to
1)
Out: Q' Q
As long as C.P is at 1, the values of Q and Q' will keep changing.
Clock pulse needs to be shorter than propagation delay to prevent that
T flip flop
Instead of set and reset, just one input, T
Master-Slave flip flop
2 next to each other
Outputs of 1 go to set and rest of the other
Pulse for the second is NOT of CP for first
Carry look-ahead logic
Simultaneous addition so there isn't as big of a propagation delay
C2=G1+P1C1
C3=G2+P2C2 = G2+P2(G1+P1C1)
C3=G2+P2G1+P2P1C1
Do a new set of gates for each bit digit
Screen clipping taken: 9/26/2008, 9:28 AM
Screen clipping taken: 9/26/2008, 9:31 AM
2s compliment (to get the negative of a binary # or subtraction
Flip all except leading 0s and the first 1
Example: compliment of 0010 would be 1110
Addition and subtraction straight forward
1s compliment
Flip all
Ex 0010 would be 1101
Addition and subtraction
If the carry carries over how many bits you are using, add 1 to the carry in
Arithmetic
22-7=15
2s compliment
11111 1111 1111 000-- carry
0000 0000 0001 0110 22
1111 1111 1111 1001 – 7 (+ -7)
0000 0000 0000 1111 =15
1s compliment
11111 1111 1110 0001 carry (+1)
0000 0000 0001 0110 22
1111 1111 1111 1000 -7
0000 0000 0000 1111 =15
Signed integers
The first bit is the sign, 1=- 0=+
Then just the regular # in binary
Number representation
Integers vs floating point numbers
Test
Boolean algebra
Kmaps
wx\yx Y0z0 Y0z1 Y1z1 y1z0
w0x0 m0 m1 m3 m2
w0x1 m4 m5 m7 m6
x0 m0 m1 m3 m2
x1 m4 m5 m7 m6
2 var
x\y 0 1
0 1 1
1 1 0
Simplification of functions
Adder
Screen clipping taken: 10/6/2008, 8:14 Pm
Flip flops
Octal x, number system
0-7
01234567 10 11 12 13 14 15 16 17 20
Compliments, 1 2
2s compliment (to get the negative of a binary # or subtraction
Flip all except leading 0s and the first 1
Example: compliment of 0010 would be 1110
Addition and subtraction straight forward
1s compliment
Flip all
Ex 0010 would be 1101
Addition and subtraction
If the carry carries over how many bits you are using, add 1 to the
carry i
Floating point
Normalize mentissa
First value in binary guarnteed to be 1, can leave it out
Bias e' = if range of exp, is 255, aka, -127 to 127, then 127 is the bias
e = é - 127
Screen clipping taken: 10/6/2008, 7:56 PM
Tuesday, October 07, 2008
1:22 PM
Test
Boolean algebra
Kmaps
wx\yx Y0z0 Y0z1 Y1z1 y1z0
w0x0 m0 m1 m3 m2
w0x1 m4 m5 m7 m6
x0 m0 m1 m3 m2
x1 m4 m5 m7 m6
2 var
x\y 0 1
0 1 1
1 1 0
Simplification of functions
Adder
Screen clipping taken: 10/6/2008, 8:14 Pm
Flip flops
Octal x, number system
0-7
01234567 10 11 12 13 14 15 16 17 20
Compliments, 1 2
2s compliment (to get the negative of a binary # or subtraction
Flip all except leading 0s and the first 1
Example: compliment of 0010 would be 1110
Addition and subtraction straight forward
1s compliment
Flip all
Ex 0010 would be 1101
Addition and subtraction
If the carry carries over how many bits you are using, add 1 to the carry i
Floating point
Normalize mentissa
First value in binary guarnteed to be 1, can leave it out
Bias e' = if range of exp, is 255, aka, -127 to 127, then 127 is the bias
e = é - 127
Screen clipping taken: 10/6/2008, 7:56 PM
Lab 1
Wednesday, August 27, 2008
8:59 AM
For each
a. Truth table
a. Kmap
a. Simplified function
a. Logic diagram
F1 (ABCD)= 0,1,2,4,5,7,11,15
1.
A B C D F1
0 0 0 0 1
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0
0 1 0 0 1
0 1 0 1 1
0 1 1 0 0
0 1 1 1 1
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
2.
AB\CD C0D0 C0D1 C1D1 C1D0
A0B0 1 1 0 1
A0B1 1 1 1 0
A1B1 0 0 1 0
A1B0 0 0 1 0
3. A'C'+BCD+ACD+A'B'D'
4.
Screen clipping taken: 9/12/2008, 4:22 PM
F2(ABCD)= 0,2,4,5,6,7,8,10,13,15
1.
A B C D F2
0 0 0 0 1
0 0 0 1 0
0 0 1 0 1
0 0 1 1 0
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0
1 1 0 1 1
1 1 1 0 0
1 1 1 1 1
2.
AB\CD C0D0 C0D1 C1D1 C1D0
A0B0 1 0 0 1
A0B1 1 1 1 1
A1B1 0 1 1 0
A1B0 1 0 0 1
3. A'B+DB+D'B'
4.
Screen clipping taken: 9/11/2008, 9:10 PM
Lab 2 adder
Wednesday, September 17, 2008
9:04 AM
Build an adder
Input for each is A1 B1 (current digit bit) and Cin
Output is S1 and Cout
Cout goes to the next Cin
Do 8 little adders like this
1's compliment
2's compliment
1's compliment +1
(put a 1 in the carry in)
If there's a carry out, ignore it, if there's no carry out, it's negative
To have both subtraction and addition on same circuit, have ex-ors before the Bs and cin
Timeline
The start is when you change cin
The end solution bit changes to 1 (*pick a number such that the last bit will change
and that will be the end
HW
Tuesday, September 23, 2008
7:31 PM
1.
a.
AB\CD C0D0 C0D1 C1D1 C1D0
A0B0 m0 m1 m3 m2
A0B1 1 m5 1 1
A0B0 m0 m1 1 m2
A0B1 m4 m5 1 m6
A1B1 m12 1 1 1
A1B0 m8 m9 1 m10
F=CD+ABD+ABC
b.
AB\CD C0D0 C0D1 C1D1 C1D0
A0B0 1 m1 m3 1
A0B1 1 1 1 1
A1B0 1 m9 m11 1
F=B'D'+A'B+BD
2. F=XY'Z+X'Y'Z+XYZ
a.
X Y Z F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
b. F=XY'Z+X'Y'Z+XYZ
F=XZ+Y'Z
3.
a. F=AB+A(CD+CD')
F=AB+ACD+ACD'
F=AB+AC
b. F=(BC'+A'D)(AB+CD')
F=A(BB)C+B(CC')D+(AA')BD+A'C(DD')
F=A(B)C+B(0)D+(0)BD+A'C(0)
F=A(BB)C+B(CC')D+(AA')BD+A'C(DD')
F=ABC
4. -
a. X'Z'+Y'Z'+YZ'+XY
i. Sum of products
X'Y'Z'+X'YZ'+XY'Z'+XYZ'+XYZ
S(0,2,4,6,7)
b. Product of sums
P(1,3,5)
(X+Y+Z')(X+Y'+Z')(X'+Y+Z')
b. AC'+B'D+A'CD+ABCD
i. Sum of products
A'B'C'D+A'B'CD+A'BCD+AB'C'D'+AB'C'D+AB'CD+ABC'D'+ABC'D+ABCD
S(1,3,7,8,9,11,12,13,15)
b. Product of sums
P(0,2,4,5,6,10,14)
(A+B+C+D)(A+B+C'+D)(A+B'+C+D)(A+B'+C+D')(A+B'+C'+D)(A'+B+C'+D)
(A'+B'+C+D)
2nd part
Friday, October 10, 2008
9:18 AM
Register Transfer and Micro operations
Code on a machine level
Execute stuff
Microprogram; stored to rom, read only, every clock pulse takes code and does stuff
If there's a bug you don't have to rewire it, just change ROM
Register
Group of flip flops
N bit registers
N flip flops
Register with parallel load
Continuous train of clock pulses
Master clock
Speed depends on processor
Memory
Collection of storage cells
Bit
Byte (8 bits)
Word
16, 32, 64
May represent anything
Binary number, instruction code, character
Structure
Byte addressable
Word addressable
RAM
Random access memory
ROM
Read only memory
m*n Rom
M words, N bits
Register transfer language
Digital circuit
Interconnection of digital hardware
Vary in size and complexity
Design in modules
Modules constructed from digital components
Registers
Multiplexors
Decoders
Arithmetic unit
Register with parallel load
Continuous train of clock pulses
Master clock
Seprate control signal required
Activate register a specific clock pulse
ROM
Non volatile; maintains even when power is off
Mask programmed
Customized
PROM
Programmable
EROM
Erasable
more modern types such as EPROM and flash EEPROM can be erased and re-programmed
multiple times; they are still described as "read-only memory" because the reprogramming
process is generally infrequent
Decoder
N bits-> 2n distinct elements
Triangle thing, tristate 2
A input, C control input
Out put Y=A if c=1, high impedance if c=0
Types of Registers
Symbol # of bits Register name Function
SC Sequence Counter
Types of executions
Register transfer notation
individual bits
R3(0..3) or PC(L)
L means least significant half of bits
R2 <-- R3
• transfer contents of R3 to R2
• R3 is unchanged
• requires circuits form output of R3 to input of R2
• control condition:
• P is control signal
if ( P==1 ) then ( R2 <- R3 )
P: R2 <- R3
every statement in RTN implies a control signal
Sync'd with clock
memory transfer
• read : MDR <-- M[MAR]
• write: M[MAR] <-- R2
R3 R1 + R2 R1 plus R2 transfered to R3
R3 R1 - R2 R1 minus R2 transfered to R3
R3 R1 + R2’ + 1 Subtract
R1 R1 + 1 Increment R1 by 1
R3 R3 - 1 Decrement R3 by 1
Instruction code
Oppcode and operands (addresses of source and targets)
direct and indirect addressing
• effective address
address to be used
• direct address (address in the current statement)
specified in instruction
• indirect addressing I=1
Instruction specifies address of address
Memory address of the operator
I = direct/indirect indicator
• basic computer
• eight registers
• memory unit
• control unit
• one common bus
• load input signal
• master clock
Instruction format
+ more
memory access
• memory read/write cycle
• if smaller than one clock cycle
• completed in one cycle
• if longer than one clock cycle
• processor must wait
• wait cycle
Instruction cycle
Fetch from mem
Decode
Read effective address from mem if necessary
Execute instruction
T0-T2 fetch and decode
T0 : AR ←PC
PC initially has address of first instruction
T1 : IR ←M[AR}, PC ←PC + 1
Clear SC to 0, first instruction
Increment SC on pulse
Move code from memory at the address specified by the Address Register,
move it to the Instruction Register
T2 : D0,...D7 ← Decode IR(12-14)
Opp code is decoded
AR ←IR(0-11)
Sends address part from instruction code to address register
I ←IR(15)
Determines In/direct type of addressing
at T3 control unit determines type of instruction
D7, least sig bit of opp code (after decode?)
0 =Means memory (from memory) reference, or 1=1 register (from multi purpose
register) reference
Then see what I=
If 0, direct addressing, don't need to do anything for execution
I/O means dealing with memory
3rd part
Wednesday, November 12, 2008
9:30 AM
Input/output and interrupts
User interface
Simple I/O
Cpu has to wait for input from keyboard/user
INPR receives byte from keyboard
FGI
Flip flop that turns to 1 when a character has come
Interrupts
Input is thousands of times slower than CPU, checking for new input as often as possible is
too slow
Informs device when input has come in so that cpu isnt constantly checking for it
Any keystroke fires off an interrupt and series of code
Assembly Language
Hardware and software
Binary codes
Difficult to understand
Programming
Assembler
High level language
Computers can only take binary