circuiti logici circuiti combinatori circuiti sequenziali pld...
Post on 12-Mar-2020
18 Views
Preview:
TRANSCRIPT
CIRCUITI LOGICI
ELETTRONICA DIGITALE
•Circuiti combinatori
•Circuiti sequenziali
•PLD
•CPLD
•FPGA
2
Logica booleana
Teoremi fondamentali: A + A * B = A; A * (A + B) = AXY + X’Z + YZ = XY + X’ZDeMorgan: (x + y)’ = x’y’; (xy)’ = x’ + y’DeMorgan generalizzato: [ f (x1, x2, …, xn, 0, 1, +, * ) ]’ =
f (x1’, x2’, …, xn’, 1, 0, *, + )Minimizzazione logica: mappe di Karnaugh– Minimizzare F = A’B + A’C + A’D + ACD– F = A’B (C’D’ + C’D + CD’ + CD)
+ A’C (B’D’ + B’D + BD’ + BD)+ A’D (B’C’ + B’C + BC’ + BC)+ ACD (B’ + B)
= A’BC’D’ + A’BC’D + A’BCD’ + A’BCD + …--> forma canonica sum-of-products (SOP)
3
Mappe di Karnaugh– Coprire la mappa e risolvere– Il risultato dovrebbe essere F = CD + A’B + A’C + A’D
(1) (2) (3) (4)
CD
A'B
A'C
A'D
F
CD
A'B
A'C
A'D
FImplementusingNANDgatesonly
Implementusing 2-inputNAND gatesonly.
00 01 11 10
00
01
11
10
CDAB
11
11 1
1 1
1
1
(1)
(2)
(3)(4)
4
Realizzazione mediante gate• Insiemi di gate funzionalmente completi
– { OR, AND, NOT}– { OR, NOT}– { AND, NOT }
– NAND e NOR sono gate universali
A + BC + DE'F
ABCDE'F
A
BC
DE'F
A
BC
DE'F
5
Progetto di logica combinatoria
• Implementazione mediante gate:– AND-OR, NAND-NAND, OR-AND, NOR-NOR, …
• Altri Gates SSI– XOR, XNOR, buffer, tri-state buffer, wired-AND
• Dispositivi MSI– MUX, DEMUX, Decoder, Encoder, Priority Encoder,– Adder, Buffer, Comparator,– Parity Generator, Parity Checker, …
• Implementazione mediante MUX:
I1
I0
sel
Out
I1
I0
sel
Out
Implementazione Three-stateImplementazione AND-OR
6
Progetto di logica combinatoria (2)• Qualunque funzione di k variabili puo` essere implementata
con MUX a 2k vie
• Qualunque funzione di k variabili puo` essere implementata con un decoder da k a 2k e porte NAND
I1I0
sel
2 - 1 MUX
Out01
x
f = x' :I1I0
sel
2 - 1 MUX
Outxx'
y
f = x'y' + xy:
I1I0
2 - 4 Decoder
xy
O3O2O1O0
f = x'y' + xy:
7
Gate CMOS
Il circuito SW-SW e’ generalizzabile con una retedi interruttori in paralleloverso Gnd ed una rete di interruttori in serie verso Val collegati agli ingressiIN1, IN2, INn
In questo modo si realizzala funzione logica NOR
Val
Gnd
IN1IN2INn
OUT
OUT = IN1 + IN2 .. + ... INn...
I CALCOLI DELLA POTENZA DISSIPATA E DEL RITARDO SONO GLI STESSI DEL’INVERTER
IN1IN2INn
...
8
Gate CMOS (2)
Se la rete superiore ha gliSW in parallelo e la reteinferiore ha gli SW in serie
si realizza la funzionelogica NAND
Val
Gnd
IN1IN2INn
OUT
I CALCOLI DELLA POTENZA DISSIPATA E DEL RITARDO SONO GLI STESSI DEL’INVERTER
IN1IN2INn
OUT = IN1 IN2 .. ... INn
...
...
9
Gate CMOS: esempio
Realizzare la funzione logica
Val
Gnd
ABC
OUT
OUT = C + ( A B )
C
A B
Calcolare Tf e Tr nelle diverse configurazioni degliingressi
(Tutte le resistenze degli switch sono uguali a RSWU e RSWd )
SUGGERIMENTO: SUGGERIMENTO: USARE LE LEGGI DI USARE LE LEGGI DI DE MORGAN!!DE MORGAN!!
ABC
B
A C
10
Circuiti sequenziali
Struttura generale di un circuito sequenziale
•Tipi di circuiti sequenziali:–Sequenziali asincroni: lo stato puo` cambiarein ogni istante–Sequenziali sincroni: lo stato puo` cambiaresolo in modo sincronocon il clock
11
Latch S-R
12
Latch e flip-flop tipo D
13
Tempistica del flip-flop
DATO UN FLIP FLOP DI TIPO D SI DICE CHE “SUL FRONTE DI SALITA DEL CLOCK SI CAMPIONA L’INGRESSO D CHE VIENE MEMORIZZATO IN USCITA” ..... MA COSA SUCCEDE SE D CAMBIA PROPRIO SUL FRONTE DEL CLOCK?
Q
Qn
CK
D
L’USCITA NON VARIA COME PREVISTO; PUO’ OSCILLARE ANCHE PER LUNGO TEMPO!METASTABILITA`
14
Tempi di set-up e hold
IL CAMPIONAMENTO DEL DATO D E’ COME FARE UNA FOTO; SE IL SOGGETTO SI MUOVE MENTRE SI SCATTA LA FOTO RIMANE MOSSA...
COME PER LE FOTO E’ NECESSARIO CHE D NON CAMBI DURANTE IL FRONTE DEL CLOCK:
Tsu = TEMPO (DI SET-UP ) PRIMA DEL FRONTE IN CUI D NON DEVE VARIARE
Th = TEMPO (DI HOLD) DOPO IL FRONTE IN CUI D NON DEVE VARIARE
D
CKTsu Th
15
Rimedi alla metastabilita`• La metastabilita` non puo` essere eliminata
completamente• Si puo` pero` ridurre la probabilita` di insorgenza del
fenomeno– Soluzioni per ingressi asincroni
1. Avere dati di ingresso con transizioni rapide2. Passare I dati in parecchi flip-flop prima di usarli
16
Macchine a stati finiti1. Macchina di Mealy:
» Le uscite dipendono dagli ingressi attuali e dallostato presente
2. Macchina di Moore:» Le uscite dipendono solo dallo stato presente
• Passi di progetto per una FSM1. Disegnare il diagramma degli stati2. Assegnare gli stati3. Ottenere la tabella delle transizioni degli stati4. Ricavare le equazioni logiche5. Disegnare il circuito logico
ESEMPIO: contatore sincrono binario a 3 bit
17
Esempio
Diagramma degli stati:
Assegnazione degli stati e tabella delle transizioni
18
Esempio (2)Equazioni per lo stato futuro:
Circuito logico:
19
Circuiti sequenziali MSI
• n-bit Register
• Shift Register
• Contatore ripple carry
20
Introduzione alle PLD
• Tipi di Programmable Logic Devices (PLDs)– Programmable Logic Array (PLA)– Programmable AND-Array Logic (PAL)– PROM e EPROM– Generic Array Logic (GAL)– Complex PLD (CPLD)– Field Programmable Gate Array (FPGA)
DALL’INIZIO DEGLI ANNI 80 SONO STATI PRODOTTI CIRCUITI INTEGRATI“PROGRAMMABILI” (PROGRAMMABLE LOGIC DEVICES - PLD -) , IN CUI L’UTENTE “PROGRAMMA” LE FUNZIONI LOGICHE DENTRO IL CHIP (HARDWARE PROGRAMMATO VIA SOFTWARE!)NEL CHIP ESISTONO ARRAY DI GATE (COMBINATORI E FF) CON LE INTERCONNESSIONI PROGRAMMABILI (IN MODO PERMANENTE O TEMPORANEO). LE FUNZIONI LOGICHE SI BASANO SUL CONCETTO DEL WIRED-OR PER CUI L’OPERAZIONE LOGICA AVVIENE TRA TUTTI GLI INGRESSI CONNESSI
21
Struttura logica di una PLAProduct Terms
Sum of Products Expressions
Programmable Connections Programmable Connections
Problema: troppe connessioni programmabili
22
ESEMPIO DI PROGRAMMAZIONE
CHE FUNZIONI REALIZZANO LE USCITE DELLA PLD?
I2 I3 I4I1 O1 O2 O3 O4
O1 = I2 I3 + I3 I4 ; O2 = I1 I4 + I1 I2 ; O3 = I1 I2 ; O4 = I2 I3 + I1 I4
23
Programmazione delle connessioni
24
Struttura di una PAL combinatoria
AND plane
Sum of Products (SoP) A B C
CBACBAf ••+••=1
CBABAf ••+•=2
Piano AND programmabile
Piano OR fisso (nr. Ingressi variabile)
25
PAL18L4
26
PAL18L4: esempio
• Esempio: Z0 = A’BC + C’D– Z0’ = (A + B’ + C’) (C + D’)
= AC + B’C + AD’ + B’D’ + C’D’
27
PAL registrate
Possono implementare strutture combinatorie e sequenziali
A B C
Flip-flop
SelectEnable
D Q
Clock
To AND plane
MUX
1f
28
PAL16R8Configurata come contatore a tre bit, in codice di Gray
Le GAL sono versioniriprogrammabili delle PAL registrateExample: GAL16V8R
–GAL configured as a “PAL16R8 type” device–8 of the 16 inputs come from the D flip-flop outputs
29
Esempio: 22V10
30
Uso di PROM e EPROM
• Struttura logica di una PROM minterms
canonical SOPs
31
Uso di PROM e EPROM (2)
• Esempio: Uso di una PROM 256 x 4 ,– Implementare f1 = w’xy’+x’yz’ + xz
e f2 = a’b’y + abx’y’ + a’bx’y’
32
CPLD
PLD block PLD block
PLD block PLD block
Interconnection wires
I/O b
lock
I/O b
lock
I/O block
I/O block
Concetto generale: molte PLD in un unico IC
•Piu` product terms;•Piu` risorse di routing;•Piu` macro celle;•Piu` connettivita` framacro celle(possibilita` di implementare funzionipiu` complesse).
33
Esempio di CPLD: Xilinx XC9500
• 5 volt in-system programmable (ISP) CPLDs
• 5 ns pin-to-pin• 36 to 288
macrocells(6400 gates)
• 10,000 program/erase cycles
• Complete IEEE 1149.1 JTAG capability
FunctionBlock 1
JTAGController
FunctionBlock 2
I/O
FunctionBlock 4
3
Global Tri-States
2 or 4
FunctionBlock 3
I/O
In- SystemProgramming Controller
FastCONNECTSwitch Matrix
JTAG Port
3
I/O
I/O
Global Set/Reset
Global Clocks
I/OBlocks
1
34
Caratteristiche dell’architettura XC9500
• Uniform, all pins fast, PAL-like architecture• FastCONNECT switch matrix provides 100% routing
with 100% utilization• Flexible function block
– 36 inputs with 18 outputs– Expandable to 90 product terms per macrocell– Product term and global three-state enables– Product term and global clocks– Product term and global set/reset signals
• 3.3V/5V I/O operation • Complete IEEE 1149.1 JTAG interface
35
XC9500: blocco funzionale
ToFastCONNECT
FromFastCONNECT
2 or 43 GlobalTri-State
GlobalClocks
I/O
I/O
36
Product-Term
Allocator
Macrocell 1
ANDArray
Macrocell 18
Ogni blocco funzionale e` come una 36V18 !
36
Esempio: Altera Max 7000
37
Esempio: Altera Max 7000 (2)
38
FIELD PROGRAMMABLE GATE ARRAY (FPGA)
DALLE PRIME PLD AD OGGI L’INTEGRAZIONE HA PERMESSO DI REALIZZARE CIRCUITI LOGICI PROGRAMMABILI MOLTO COMPLESSI. SI CHIAMANO FIELD-PROGRAMMABLE-GATE-ARRAY (FPGA) E STANNO RIMPIAZZANDO I CIRCUITI REALIZZATI CON LE FAMIGLIE LOGICHE TRADIZIONALI IN NUMEROSE APPLICAZIONI.
CELLE LOGICHE PROGRAMMABILI
INTERCONNESSIONI PROGRAMMABILI
CELLE DI I/O PROGRAMMABILI
39
FAMIGLIE LOGICHE AVANZATEFPGA
AD OGGI SONO DISPONIBILI SUL MERCATO FPGA CON DIVERSI MILIONI DI GATE PROGRAMMABILI E CON DIVERSE CENTINAIA DI KBIT DI MEMORIA.
LAVORANO A CENTINAIA DI MHz CON PIU’ DI 500 PIN DI I/O
DEVICE SYSTEM GATES
LOGIC GATES
DIFF I/O PAIRS
USER I/O BLOCK RAM Bits
DISTRIB. RAM Bits
XCV200E 214.640 63.504 119 284 114.688 75.264
XCV600E 985.882 186.624 247 512 294.912 221.184
XCV2000E 2.541.952 518.400 344 804 655.360 614.400
XCV3200E 4.074.387 876.096 344 804 851.968 1.038.336
40
FPGA: struttura generale
I/O block
I/O block
I/O block
I/O b
lock
Logic block Interconnection switches
LUT
Flip-flop
Clock
Out
Select
In1
In2In3In4
D Q
Blocco logico base
La Look-up-table puo` essere usata:
1. Funzione booleana di 4 ingressi
2. Memoria 16x1
41
Esempio: funzione di 4 variabili
A B C D Out
0 0 0 0 00 0 0 1 10 0 1 0 10 0 1 1 10 1 0 0 00 1 0 1 10 1 1 0 10 1 1 1 11 0 0 0 01 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 01 1 0 1 01 1 1 0 01 1 1 1 0
A
B
C
D
Out
AB
CD
Out
42
Interconnessioni programmabili
LB
LB
LB
LB
LB
LB
Switch Matrix
Switch Matrix
43
Funzionamento delle switch matrixPrima della programmazione Dopo la programmazione
44
Differenze CPLD - FPGACPLD FPGA
Architecture PAL/22V10-like Gate array-likeMore Combinational More Registers + RAM
Density Low-to-medium Medium-to-high0.5-10K logic gates 1K to 1M system gates
Performance Predictable timing Application dependentUp to 250 MHz today Up to 150MHz today
Interconnect “Crossbar Switch” Incremental
Complex Programmable Logic Device Field-Programmable Gate Array
45
FPGA a grana fine e grossa
Grana grossa (tecnologia SRAM) – per es. Altera, Xilinx
• Blocchi logici grandi e complessi• Funzioni dedicate (per es. RAM o catene di propagazione del carry)• Riprogrammabili• Ritardi di propagazione non predicibili
Grana fine (tecnologia Antifuse) – per es. Actel
• Blocchi logici piccoli• Ritardi di propagazione predicibili• Velocita` superiori• One time programmable (OTP)
46
FPGA - Xilinx 4000 Series – struttura
Long lines
I/O blocks
CLB CLB CLB CLB
CLB CLB CLB CLB
CLB CLB CLB CLB
CLBCLBCLBCLBSwitch Matrix
Single length
47
FPGA - Xilinx 4000 Series - CLB
48
FPGA - Xilinx 4000 Series – CLB
Two 4-input function generators (F and G) offer unrestricted versatility (most combinatorial logic functions need four or fewer inputs). A third function generator, labeled H’, can implement any Boolean function of its three inputs.
The CLB storage elements can be configured as latches or flip-flops, positive or negative edge triggered. An asynchronous storage element input (SR) can be configured as either set or reset. This configuration option determines the state in which each flip-flop becomes operational after configuration.
Multiplexers in the CLB map the four control inputs (C1 - C4) into the four internal control signals (H1, DIN/H2, SR/H0, and EC). Any of these inputs can drive any of the four internal control signals.
Optional modes for each CLB make the memory look-up tables in the F’ and G’ function generators usable as an array of Read/Write memory cells. Depending on the selected mode, a single CLB can be configured as either a 16x2, 32x1, or 16x1 bit array.
The F1-F4 and G1-G4 inputs to the function generators act as address lines, selecting a particular memory cell in each look-up table. The DIN/H2, H1, and SR/H0 lines become the two data inputs (D0, D1) and the Write Enable (WE) input for the 16x2 memory. When the 32x1 configuration is selected, D1 acts as the fifth address bit and D0 is the data input.
49
FPGA - Xilinx 4000 Series – IO block
50
FPGA - Xilinx 4000 Series – IO block
Segnali di ingressoUser-configurable input/output blocks (IOBs) provide the interface between external package pins and the internal logic.
Each IOB controls one package pin and can be configured for input, output, or bidirectional signals.
Two paths, labeled I1 and I2, bring input signals into the array. Inputs also connect to an input register that can be programmed as either an edge-triggered flip-flop or a level-sensitive latch.
The data input to the register can optionally be delayed by several nanoseconds. With the delay enabled, the setup time of the input flip-flop is increased so that normal clock routing does not result in a positive hold-time requirement. The delay guarantees a zero hold time with respect to clocks routed through any of the global clock buffers.
An additional optional latch on the input is clocked by the output clock; this additional latch allows the very fast capture of input data, which is then synchronized to the internal clock by the IOB flip-flop or latch.
51
FPGA - Xilinx 4000 Series – IO block
Segnali di uscitaOutput signals can be optionally inverted within the IOB, and can pass directly to the pad or be stored in an edge-triggered flip-flop.
An active-High 3-state signal can be used to place the output buffer in a high-impedance state, implementing 3-state outputs or bidirectional I/O.
FPGAs can directly drive buses on a printed circuit board, since a guaranteed output sink current of 12 mA is given. The output pull-up structure can be configured as a TTL-like totem-pole or as CMOS drivers, with p-channel pull-up transistors pulling to Vcc.
A multiplexer can be configured as a 2-input function generator, implementing a pass-gate, AND-gate, OR-gate, or XOR-gate, with 0, 1, or 2 inverted inputs:
•When configured as a multiplexer, this feature allows two output signals to time-share the same output pad, effectively doubling the number of device outputs without requiring a larger, more expensive package.
•When the MUX is configured as a 2-input function generator, logic can be implemented within the IOB itself, so allowing for very high-speed gating of a single signal.
52
FPGA - Xilinx 4000 Series – routing
• 1) Fast Direct Interconnect - CLB to CLB• 2) General Purpose Interconnect - Uses switch matrix
CLBCLB
CLBCLB
CLBCLB
CLBCLB
SwitchMatrix
SwitchMatrix
• 3) Long Lines– Segmented across
chip– Global clocks, lowest
skew– 2 Tri-states per CLB
for busses• Other routing types in
CPLDs
53
FPGA - Xilinx 4000 Series – altre risorse
• Tri-state buffers for busses (BUFT’s)• Global clock & high speed buffers
(BUFG’s)• Wide Decoders (DECODEx)• Internal Oscillator (OSC4)• Global Reset to all Flip-Flops,
Latches (STARTUP)• CLB special resources
– Fast Carry logic built into CLBs– Synchronous Dual Port RAM– Boundary Scan
54
FPGA - Altera FLEX 10K - struttura
55
FPGA - Altera FLEX 10K – Logic Element
FLEX 10K Series Logic Element (LE), from Altera FLEX 10K data sheet
56
FPGA - Altera FLEX 10K - EAB
Embedded Array Block (EAB)
57
Esempio di FPGA a grana fine - Actel SX - struttura
58
FPGA Example - Actel SX Family – celle R e C
Cella C Cella R
59
Tecnologia delle interconnessioni
Static Random Access Memory (SRAM)• ogni switch e` un pass transistor controllato dallo stato di una cella SRAM• Richiede una PROM per configurare la FPGA al power-on
Electrically Erasable Programmable ROM (EPROM)• ogni switch e` un transistor floating-gate. Il codice di configurazione e`
residente nella FPGA• Riprogrammabile, anche in-circuit (ISP/JTAG)
Fusible Links - one time programmable (“Antifuse”)• Quando e` programmato elettricamente, forma un percorso a bassa
resistenza• one-time programmable, mediante hardware apposito• radiation tolerant
60
Esempio di FPGA - Actel SX Family
from Actel’s SX Family of FPGA’s - Technology Backgrounder
Tutto il dispositivo e` coperto da unagriglia di moduli logici
Le risorse di routing and interconnessionestanno sotto la griglia
Architettura tipo “sea-of-modules”
61
Tagli tipici
No of I/O No of regs Memory
Altera 20K30E-2 128 1200 24 Kbits
Altera 20K200E-1 376 8320 100 Kbits
Altera EP2A15C7 492 16640 450 Kbits
Xilinx XC2S15-5 86 384 16 Kbits
Xilinx XC2S200-5 284 4704 57 Kbits
Xilinx XC2V3000 684 28672 1728 Kbits
I prezzi dipendono anche dalla velocita`. (per es. La versione piu` veloce puo` essere piu` costosa del 50%).I dispositivi in tabella costano da $30 a $900. Una PLD a 32 registricosta da $2
Serve anche il dispositivo di configurazione: Altera PROM: $8, EEPROM: $21
62
Flusso di progetto con FPGA - CPLD
XC4000XC4000XC4000
3
Design Entry in schematic, ABEL, VHDL, and/or Verilog. Vendors include Synopsys, Aldec (Xilinx Foundation), Mentor, Cadence, Viewlogic, and 35 others.
Implementation includes Placement & Routing and bitstream generation using Xilinx’s M1 Technology. Also, analyze timing, view layout, and more.
Download directly to the Xilinxhardware device(s) with
unlimited reconfigurations* !!
1
2
*XC9500 has 20,000 write/erase cycles
M1 Technology
63
Flusso di progetto
IL PROGETTO E LA PROGRAMMAZIONE AVVIENE MEDIANTE STRUMENTI CAD CON IL SEGUENTE DESIGN FLOW:
DESIGN ENTRY PRELAYOUT SIMULATION
LOGIC SYNTHESIS
SYSTEM PARTITIONING
FLOORPLANNING POSTLAYOUT SIMULATION
PLACEMENT
ROUTING CIRCUIT EXTRACTION
PROGRAMMING
Start
End
top related