Professional Documents
Culture Documents
to Computing
Chapter 3:
Digital Logic Structures
Devices, Circuits,
Data Path
Memory
Storage Elements
Decoder
Mux (multiplexer)
Adder
Logic Gates
R-S Latch
Gated D latch
Register
Logic Structures
Algorithms
NOT
OR
AND
Other gates
Transistors
Language
Bottom Up
Problem
Micro-architecture
Circuits
Devices
4
Memory
primary access by the CPU or secondary (indirect)
access by the CPU. Based on the speed of access to the
memory.
volatile or non-volatile is a distinction based on
technology (magnetic vs. electrical, etc.). Volatile
memory requires power to maintain its stored
information.
Read-only memory, or read-write is a distinction based
on properties of the memory. Read only memory, or
"ROM", is not modifiable.
Random-Access or Sequential-Access, is a distinction
based on the mechanism of reading the memory.
http://en.wikipedia.org/wiki/Giant_magnetoresistive_effect
6
Disclaimer
Not all electronic computers are made from
transistors. Electronic logic can be built from
vacuum tubes
magnetic amplifiers, core, bubbles
superconducting cryotrons
superconducting Josephson junctions
Intel Processors
April 1972
Name of Processor: 8008
Clock speed: 200 kHz
Number of transistors: 3,500
March 1993
Name of Processor: Pentium
Clock speed: 60 MHz
Number of transistors: 3.1 million
September 1978
Name of Processor: 8086
Clock speed: 10 MHz
Number of transistors: 29,000
May 1997
Name of Processor: Pentium II
Clock speed: 300 MHz
Number of transistors: 3.3 million
February 1982
Name of Processor: 286
Clock speed: 12 MHz
Number of transistors: 134,000
August 1999
Name of Processor: Pentium III
Clock speed: 600 MHz
Number of transistors: 9.5 million
October 1985
Name of Processor: 386
Clock speed: 16 MHz
Number of transistors: 275,000
November 2000
Name of Processor: Pentium 4
Clock speed: 1.5 GHz
Number of transistors: 42 million
April 1989
Name of Processor: 486
Clock speed: 25 MHz
Number of transistors: 1,200,000
Nov 2002
Name of Processor: Pentium 4
Clock speed: 3.0 GHz
Number of transistors: 55 million
8
Transistor as a Switch
Switches are devices with discrete state
changes that enable, disable, or direct a
flow.
Switch Closed
Switch Open
Open Circuit
No current through circuit
Light is OFF
Vout = 2.9V
1
Voltage is
a relative
quantity
Closed Circuit
Short circuit across switch
Current flows
Light is on
Vout is 0 V
0
0V
10
Mos:Metal-Oxide-Semiconductor
Metal-Oxide-Semiconductor Field Effect Transistor (MOSFET).
11
Some n-type
when Gate has positive voltage,
short circuit between #1 and #2
(switch closed, light on)
when Gate has zero voltage,
open circuit between #1 and #2
(switch open, light off)
Gate = 1
Gate = 0
Terminal #2 must be
connected to GND (0V).
12
Gate = 1
Gate = 0
Terminal #1 is
connected to +2.9V.
13
MOS Transistor
MOS means Metal-Oxide Semiconductor
A AND B
B
A AND B
Circuits
Devices
15
Logic Gates
Use switch behavior of MOS transistors to
implement logical functions: AND, OR, NOT
Digital symbols:
assign a range of analog voltages to each
digital (logic) symbol
Out=1
In=1
Out=0
ground
Out
In
Out
0 Volts
2.9 Volts
2.9 Volts
0 Volts
In
17
NOR Gate
A=0
B=1
C=
A B C
0 0
0 1
1 0
1 1
Note: Serial structure on top, parallel on bottom.
18
NOR Gate
A=0
B=1
C=0
A B C
0 0
0 1 0
1 0
1 1
Note: Serial structure on top, parallel on bottom.
19
NOR Gate
A=1
B=1
C=
A B C
0 0
0 1
1 0
1 1
Note: Serial structure on top, parallel on bottom.
20
NOR Gate
A=1
B=1
C=0
A B C
0 0
0 1
1 0
1 1 0
Note: Serial structure on top, parallel on bottom.
21
NOR Gate
A=0
B=0
C=1
A B C
0 0 1
0 1 0
1 0 0
1 1 0
Note: Serial structure on top, parallel on bottom.
22
NOR Gate
A=1
B=0
C=0
A B C
0 0 1
0 1 0
1 0 0
1 1 0
Note: Serial structure on top, parallel on bottom.
23
OR Gate
A
0
0
1
1
NOR
B
0
1
0
1
C
0
1
1
1
NOT
24
A B C
0 0
0 1
1 0
1 1
AND Gate
A B
0 0
0 1
1 0
1 1
1
26
27
DeMorgan's Law
Converting AND to OR (with some help from NOT)
Using only AND, NOT gate to implement OR
28
DeMorgan's Law
Converting AND to OR (with some help from NOT)
Consider the following gate:
A
0
0
1
1
B
0
1
0
1
A B
A B
1
1
0
0
1
0
1
0
1
0
0
0
0
1
1
1
To convert AND to OR
(or vice versa),
invert both inputs
and outputs.
Same as A+B
29
30
Summary
MOS transistors are used as switches to implement
logic functions.
Some n-type: connect to GND, in=0, out=1
Some p-type: connect to +2.9V, in=1, out =1
Basic gates: NOT, NOR, NAND
Basic logic functions are AND, OR, and NOT
DeMorgan's Law
Convert AND to OR (and vice versa) by inverting inputs and
output
31
2.
32
A NAND B = A B
A
0
0
1
1
B
0
1
0
1
C
1
1
1
0
Logic circuit
34
Decoder
Code
Decoder
(e.g. 0110)
35
2-bit Decoder
A
0
0
1
1
B output
0 1000
1 0100
0 0010
1 0001
36
Decoder
A n-input decoder has 2n outputs.
4 input, how many outputs?
2-bit Decoder
MMLogic: Multimedia Logic
http://www.softronix.com/logic.html
38
Multiplexer (MUX)
n-bit selector and 2n inputs, one output
output equals one of the inputs, depending on selector
4-to-1 MUX
Out = A S0 S1 + B S0 S1 + C S0 S1 + D S0 S1
39
MUX
40
Multiplexer (MUX)
n-bit selector and 2n inputs, one output
output equals one of the inputs, depending on selector
4-to-1 MUX
Out = A S0 S1 + B S0 S1 + C S0 S1 + D S0 S1
41
Multiplexer (MUX)
A MUX has 2n data inputs, n control
inputs (select lines), and 1 output
MUX Example
Printing in a computer lab with 4 computers
4-to-1 MUX
43
Adder
Generally, addition results in
sum and carry, where carry is
used for next bit addition
Example: A + B
1 11
01010 11 1
00100 11 1
Full Adder
3 inputs
2 outputs: sum and carry
01111 11 0
44
Full Adder
Add two bits and carry-in, produce one-bit sum and
carry-out
Examples
0+0+1
sum = 1, carry = 0
1+1+0
sum = 0, carry = 1
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
0 1
0 1
0
1
1
0
0
1
1
1
1
1
0
1
0
1
1
0
0
1
0
1
1
1
0
0
1
1
45
Full Adder
Add two bits and carry-in, produce one-bit sum and carryout
A B Cin S Cout
0 0 0 0 0 0
1
2
0 0
0 1
1
0
1
1
0
0
0 1
1 0
1 0
1 1
1 1
Row
46
Full Adder
47
Four-bit Adder
Example: add two 4-bit
binary numbers A and B
1 1 1 0
Cin
0 1 1 1
0 1 1 1
A[3:0]
B[3:0]
1 1 1 0
S[3:0]
0 1 1 1
Cout
48