Beruflich Dokumente
Kultur Dokumente
N-type
Attached to GND
Pulls output voltage DOWN when input is one
Truth table
In Out In Out
0 V 2.9 V 0 1
2.9 V 0V 1 0
A P
B P
C
A B C
N 0 0 1
0 1 0
N
1 0 0
0v 1 1 0
0v
Introduction to Computing Systems and Programming Fall 1384, 12
NOR Gate Operation
2.9 v 2.9 v 2.9 v
2.9 v 2.9 v
0v P P
P
2.9 v 0v
0v P P P
2.9 v 0v 0v
N N N
N N
N
0v 0v 0v
0 v Systems and Programming
Introduction to Computing 0v 0 v 13
Fall 1384,
OR Gate
A B C
0 0 0
0 1 1
1 0 1
1 1 1
A B C
0 0 1
0 1 1
1 0 1
1 1 0
Introduction to Computing Systems and Programming Fall 1384, 15
AND Gate
A B C
0 0 0
0 1 0
1 0 0
1 1 1
A B C A B C
0 0 0 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 1
i=2
1, iff A,B is 10
i=3
1, iff A,B is 11
4-to-1 MUX
Introduction to Computing Systems and Programming Fall 1384, 24
Half Adder
Half Adder A B C S
2 inputs 0 0 0 0
0 1 0 1
2 outputs: sum and carry 1 0 0 1
1 1 1 0
1 0 0 1
0
1 1
0 0
1
0
0
Output changes to one.
1 1
0
0 1
1
1 0
R=S=0
both outputs equal one
final state determined by electrical properties of gates
Don’t do it!
Introduction to Computing Systems and Programming Fall 1384, 32
Gated D-Latch
Address Space:
k = 2n
number of locations locations •
(usually a power of 2) •
•
Addressability:
number of bits per location m bits
(e.g., byte-addressable)
Introduction to Computing Systems and Programming Fall 1384, 35
Address Space
WE
Each bit
is a gated D-latch
Each location
consists of w bits (here w = 1)
w = 8 if the memory is byte
addressable
Addressing
n locations means log2n address
bits (here 2 bits => 4 locations)
decoder circuit translates
address into 1 of n addresses
A 22 by 3 bits memory:
•two address lines: A[1:0]
•three data lines: D[2:0]
•one control line: WE
One gated
D-latch
address
decoder
Introduction to Computing Systemsoutput bits
and Programming Fall 1384, 40
Memory details
This is a not the way actual memory is implemented.
fewer transistors, much more dense, relies on electrical properties
But the logical structure is very similar.
address decoder
word select line
word write enable
Two basic kinds of RAM (Random Access Memory)
Static RAM (SRAM)
fast, maintains data without power
Dynamic RAM (DRAM)
slower but denser, bit storage must be periodically refreshed
Introduction to Computing Systems and Programming Fall 1384, 41
Memory building blocks
– Building an 8K byte memory using chips that are 2K by 4 bits.
CS = chip select:
A10-A0 2K x 4 bits 2K x 4 bits when set, it enables
CS CS the addressing,
reading and writing
d
2K x 4 bits 2K x 4 bits of that chip.
CS CS
e
A12-A11 c
o
d 2K x 4 bits 2K x 4 bits
er CS CS
This is an 8KB
byte addressable
2K x 4 bits 2K x 4 bits memory
CS CS