Title: , PeiYin Chen,
1FPGA????
Logic Design
- ???, Pei-Yin Chen, ???????????
- pychen_at_csie.ncku.edu.tw
2Computers and Electricity
- Computers are electronic devices(????) (all
binary) - range of 01 volt is low -- binary 0
- range of 25 volt is high -- binary 1
- Gate(???) A device that performs a basic
operation on electrical signals, accepting one or
more input signals and producing a single output
signals - Circuits(??) A combination of interacting gates
designed to accomplish a specific logical
function (the output of a gate often serves as
an input for one or more other gates)
3Computers and Electricity
- There are three different, but equally powerful,
notational methods for describing the behavior of
gates and circuits - Boolean expressions (?????)
- logic diagrams (???)
- truth tables (???)
4Computers and Electricity
- Boolean expressions Expressions in Boolean
algebra(????), a mathematical notation for
expressing two-valued logic - This algebraic notation are an elegant and
powerful way to demonstrate the activity of
electrical circuits
X is the output signal A and B are input signals
5Computers and Electricity
- Logic diagram A graphical representation of a
circuit - Each type of gate is represented by a specific
graphical symbol - Truth table A table showing all possible input
combinations and the associated output values
inputs
outputs
6Gates
- Lets examine the processing of the following
six types of gates (accept one or more inputs
and produce a single output) - NOT
- AND
- OR
- XOR
- NAND
- NOR
- Typically, logic diagrams are black and white,
and the gates are distinguished only by their
shape
7NOT Gate
- A NOT gate (???)accepts one input value and
produces one output value
left(input) right(output)
A(input) X(output)
input output
or
inversion bubble
negate the input
01 10
Various representations of a NOT gate
8NOT Gate
- By definition, if the input value for a NOT gate
is 0, the output value is 1, and if the input
value is 1, the output is 0 - A NOT gate is sometimes referred to as an
inverter because it inverts the input value
01 10
input signal(s)? output signal?
9AND Gate
- An AND gate (??)accepts two input signals
- If the two input values for an AND gate are both
1, the output is 1 otherwise, the output is 0
10OR Gate (??)
- If the two input values are both 0, the output
value is 0 otherwise, the output is 1
Various representations of a OR gate
11XOR Gate
- XOR, or exclusive OR, gate (????)
- An XOR gate produces 0 if its two inputs are the
same, and a 1 otherwise - Note the difference between the XOR gate and the
OR gate they differ only in one input situation - When both input signals are 1, the OR gate
produces a 1 and the XOR produces a 0
12XOR Gate
13NAND and NOR Gates
- The NAND (???) and NOR(???) gates are essentially
the opposite of the AND and OR gates, respectively
NAND gate
NOR gate
415
14Review of Gate Processing
- A NOT gate inverts its single input value
- An AND gate produces 1 if both input values are 1
- An OR gate produces 1 if one or the other or both
input values are 1
15Review of Gate Processing
- An XOR gate produces 1 if one or the other (but
not both) input values are 1 - A NAND gate produces the opposite results of an
AND gate - A NOR gate produces the opposite results of an OR
gate
16Gates with More Inputs
- Gates can be designed to accept three or more
input values - A three-input AND gate, for example, produces an
output of 1 only if all input values are 1
All possible input combinations must be described
in Truth Table
17Constructing Gates
- Transistor(???) A device that acts, depending on
the voltage level of an input signal, either as a
wire (??) that conducts electricity or as a
resistor(??) that blocks the flow of electricity - A transistor has no moving parts, yet acts like a
switch - It is made of a semiconductor(???) material,
which is neither a particularly good conductor of
electricity, such as copper, nor a particularly
good insulator, such as rubber
18Constructing Gates
- A transistor has three terminals
- A source (feed with 5 volts)
- A base
- An emitter, typically connected to a ground wire
- If the base signal is high (close to 5 volts),
the source signal is grounded and the output
signal is low (0). If the base signal is low
(close to 0 volts), the source signal stays high
and the output signal is high (1)
5 volts
The connections of a transistor
19Constructing Gates
- It turns out that, because the way a transistor
works, the easiest gates to create are the NOT,
NAND, and NOR gates
V1 V2 Vout 0 0 1 0 1 1 1 0
1 1 1 0
V1 V2 Vout 0 0 1 0 1 0 1 0
0 1 1 0
Vin Vout 0 1 1 0
20Circuits
- Circuits A combination of interacting gates
designed to accomplish a specific logical
function - Two general categories
- In a combinational circuit(????), the input
values explicitly determine the output - In a sequential circuit(????), the output is a
function of the input values as well as the
existing state of the circuit - As with gates, we can describe the operations of
entire circuits using three notations - Boolean expressions, logic diagrams, truth
tables
21Combinational Circuits
- Gates are combined into circuits by using the
output of one gate as the input for another
22Combinational Circuits
- Because there are three inputs to this circuit,
eight rows are required to describe all possible
input combinations - This same circuit using Boolean algebra is (AB
AC)
23Now lets go the other way lets take a Boolean
expression and draw
- Consider the following Boolean expression A(B C)
- Now compare the final result column in this truth
table to the truth table for the previous example - They are identical
24Now lets go the other way lets take a Boolean
expression and draw
- We have therefore just demonstrated circuit
equivalence(????) - That is, both circuits produce the exact same
output for each input value combination - Boolean algebra allows us to apply provable
mathematical principles to help us design
logical circuits
A(B C)ABAC
25Properties of Boolean Algebra
26Adders(???)
- At the digital logic level, addition is performed
in binary - Addition operations are carried out by special
circuits called, appropriately, adders
27Adders
- The result of adding two binary digits could
produce a carry value - Recall that 1 1 10 in base two
- A circuit that computes the sum of two bits and
produces the correct carry bit(????) is called a
half adder(???)
28Adders
- Circuit diagram representing a half adder
- Two Boolean expressions
- sum A ? B
- carry AB
one-bit adder How about 8-bit ?
29Combinational Circuits (1/2)
30Combinational Circuits (2/2)
31Sequential Circuits (1/2)
- Combinational circuits
- contains no memory elements
- the outputs depends on the inputs
- Sequential circuits
- a feedback path
- the state of the sequential circuit
- (inputs, current state) Þ (outputs, next state)
- synchronous the transition happens at discrete
instants of time - asynchronous at any instant of time
32Sequential Circuits (2/2)
33Integrated Circuits
- Integrated circuit(????) (also called a chip) A
piece of silicon(?) on which multiple gates have
been embedded - These silicon pieces are mounted on a plastic or
ceramic package with pins along the edges that
can be soldered onto circuit boards or inserted
into appropriate sockets
34Integrated Circuits
data sheet
Figure 4.13 An SSI chip contains independent
NAND gates
35Integrated Circuits
- Integrated circuits (IC) are classified by the
number of gates contained in them
36Integrated Circuits
12 13
1
3
8
1
2
2
1
3
2
Multiple chips (gates) combined to a circuit to
solve a specific problem(??????)
37Example Alarm
Assume that four persons might come. Alarm is
activated when (1) more than three persons come
or (2) the fourth person come together with other
persons
Out AD BD CD ABC
38Example Alarm
Out AD BD CD ABC
A B C D
two chips
(from sensors or buttons)
Out (might connect to bell)
and-chip
or-chip (commercial ASIC chips)
A B C D
(from sensors or buttons)
Out (might connect to bell)
one chip (a dedicated chip) -- ASIC
Application Specific Integrated Circuit -- ASIC
39IC Industry in Taiwan
????
????
????
???????
? ?
??
??
??
??
??
??
???
??
???
40CPU Chips
- The most important integrated circuit (IC)in any
computer is the Central Processing Unit(??????),
or CPU - Each CPU chip has a large number of pins(??)
through which essentially all communication in a
computer system occurs - The communication connects the CPU to memory and
I/O devices
41Design Entry for VLSI System
Choose the design entry method
Schematic Gate level design Intuitive
easy to debug HDL (Hardware Description
Language) Descriptive portable Easy
to modify Mixed HDL Schematic
always _at_(IN) begin OUT (IN0 IN1)
(IN2 IN3) end
42Hierarchical Components in PCB
- Describe the circuits with
- Hardware Description Language
- (HDL??????)
- 2. Synthesis (??) the circuits
- .
-
application specific integrated circuit (ASIC??)
IC or chip
43Circuit Design Process
System Spec.
Partitioning
Fabrication
VLSI Design/Sim/Ver
Wafer Test
Post-Layout Sim/Ver
Packaging
Masking
Final Test
44IC Design flow
IC design flow
Full Custom
Semi Custom (Cell-Based Design)
- Standard Cells
- TSMC, UMC-cells
- b. FPGA or PLD Programmable logic
- Xilinx, Altera, Actel-cells
ASIC
Full (Fully) Custom Design
- For analog circuits and digital circuits
requiring custom optimization - Gates, transistors and layout are designed and
optimized by the engineer
Semi Custom Design
- For larger digital circuits
- Real gates, transistors and layout are
synthesized and optimized by - related software tools
- c. Realization with hardware description
language (HDL) such as VHDL and - Verilog
45Full Custom Design (??????)
CMOS Inverter
in
out
- Digital circuits requiring custom optimization
(smaller system) - Analog circuits
- Long design cycle
- (transistors and wires)
- d. No CPLD or FPGA solutions
done by chip designer
masking
done by TSMC, UMC
Packing, Testing
46Semi Custom Design (??????)
Semi Custom Design
- Product specification
- Modeling with HDL
- Synthesis (by using suitable standard cell)
- Simulation and verification
- Physical placement and layout
- Tape-out (real chip)
- Testing
-- implemented with suitable tools
-- implemented by suitable Fab companies
-- implemented by suitable tools and mechanisms
more flexible, shorter design cycle, suitable for
smaller production
PLD
Xilinx, Altera
FPGA or CPLD
Two different solutions
Real ASIC chip
Fab (TSMC, UMC, ..)
Standard cell
less flexible, long design cycle, larger-scale
production to reduce price
47Synthesis Flow of Semi Custom design (1/2)
Behavioral requirement
Verification and analysis Behavioral simulation
Synthesis High level synthesis
Functional design
Behavioral representation Boolean equations and
RTL
Verification and analysis Logic verification,
Logic simulation Testing
Logic design
Synthesis Logic synthesis
Structural representation Logic gates, connections
Synthesis Cell generators
Circuit design
Verification and analysis Circuit simulation,
Circuit analysis
Structural representation Transistors and
connections
Synthesis Floorplanning, Placement, Routing
Physical design
Verification and analysis Design-rule
checking Circuit extraction
Physical representation Mask layout rectangles
48Synthesis Flow of Semi Custom design (2/2)
49Synthesis (1/3)
- Synthesis TranslationOptimizationMapping
always _at_() if (ab) if (c1)
df else d1
else d0
Translate into Boolean Representation
f
a
b
d
Optimize Map
HDL Source
c
f
c
d
a
Process of logic synthesis
b
Target Technology
50Synthesis (2/3)
- Synthesis is constraint-driven
- You set the goals. Design Compiler optimizes
design toward goals.
Large
Area
Small
Fast
Slow
Speed
51Synthesis (3/3)
- Providing an environment and various tools for
the designers to produce circuits automatically
and efficiently to meet the requirements of - performance
- area
- testability