Digitala elektroniksystem Professor Per Larsson-Edefors perla@chalmers.se Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 1 Konstruktionsalternativ Kretskort med diskreta standardkomponenter Utvecklingskostnad och prestanda låga Rekonfigurerbara kretsar Utvecklingskostnad och prestanda medelhöga Applikationsspecifika kretsar Utvecklingskostnad k t och prestanda höga -> stora serier Hög integration (System på kisel), digitalt och analogt Introduktion Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 2 1
Blanda digitalt och analogt; en-chips DVB-mottagare Introduktion Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 3 Introduktion Moderkort med dual-core processor Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 4 2
Introduktion Dual-core processor Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 5 Introduktion 65-nm dual-core Xeon (Tulsa) Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 6 3
FlexCore en Chalmersprocessor Introduktion Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 7 Utbyggbar processor Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 8 4
Introduktion FlexCores dataväg/buss Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 9 Konstruktion av digital hårdvara Hårdvarubeskrivande språk: Ett mjukvaruliknande språk som beskriver hårdvaran funktionellt/logiskt. VHDL, Verilog, etc. Låt oss bygga en ALU Konstruktionsmetodik Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 10 5
Konstruktionsmetodik Specifikation 0000: Signed add A B Add 0101: A OR B Op Logic Outs Clk Reset Shift Skift-operationer Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 11 In- och utregister Konstruktionsmetodik Inregister ALU Utregister Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 12 6
Konstruktionsmetodik VHDL öppna ALUns portar entity ALU is port(clk : in std_logic; Reset : in std_logic; A : in std_logic_vector(31 downto 0); B : in std_logic_vector(31 downto 0); Op : in std_logic_vector(3 t downto 0); Outs : out std_logic_vector(31 downto 0)); end ALU; Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 13 Konstruktionsmetodik VHDL inkludera adderare architecture RTL of ALU is component Adder port ( OpA : in std_logic_vector(31 downto 0); OpB : in std_logic_vector(31 downto 0); Cin : in std_logic; Cout : out std_logic; Result : out std_logic_vector(31 downto 0)); end component; Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 14 7
VHDL definiera register process begin if Reset='1' then ALU_inA <= (others => '0'); ALU_inB <= (others => '0'); elsif rising_edge(clk) then ALU_inA <= A; ALU_inB <= B; end if; end process; Konstruktionsmetodik Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 15 VHDL definiera logik process begin case ALU_op is when "0000" => ALU_Out <= Add_Out;... when "0101" => ALU_Out <= ALU_InA or ALU_InB; Konstruktionsmetodik Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 16 8
Konstruktionsmetodik Verifiering Simulering av hårdvarubeskrivningen avslöjar om vi konstruerat det vi avsett, om specifikationen och VHDL-implementationen överensstämmer. Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 17 Simulering Konstruktionsmetodik Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 18 9
Fler datorhjälpmedel När vår beskrivning är korrekt, omvandlar CAD-verktyg denna beskrivning till fysiska kretsar, under villkor på fördröjning mellan register. Konstruktionsmetodik Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 19 ASIC Design Flow Konstruktionsmetodik Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 20 10
Konstruktionsmetodik Standardcells-konstruktion Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 21 Slutresultatet Konstruktionsmetodik Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 22 11
Adderare i processorer Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 23 Addition 111111111111111111111111111 + 000000000000000000000000001 1000000000000000000000000000 Vi måste alltid konstruera för de värsta fallen som kan hända! Längst fördröjning = en carrybit i LSB ripplar ända till MSB. Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 24 12
Ripple-Carry Adder a N-1 1 b N-1 1 a 1 b 1 a 0 b 0 0 C N-1 C 1 + + + C 0 S N-1 S 1 S 0 Ripple-carry-adderare (RCA): längsta fördröjningen beror linjärt av ordlängden. Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 25 Heladderaren Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 26 13
Transistorkrets för heladderare a b c c a b b b c a C a c a a S a b b b a b c c Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 27 Titta speciellt på carryvägen a 1 b 1 b 1 a 1 a 0 b 0 b 0 a 0 a 1 a 0 a 1 b 1 b 1 a 0 b 0 b 0 Det finns nu onödiga inverterare i kritiska vägen. Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 28 14
En snabbare carryväg a 1 b 1 b 1 b a 0 b0 b 0 a 1 C ut1 a 0 C ut0 a 1 a 0 a 1 b 1 b 1 a 0 b 0 b 0 Utnyttjar att C (a, b, c) = C(a, b, c ) Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 29 Bättre, men fortfarande N a 3 a 2 b 2 b 3 a 1 b 1 a 0 b 0 C 3 C 2 + + + + C 1 C 0 S 3 S 2 S 1 S 0 Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 30 15
Studera ingångarna! a N-1 b N-1 a 1 b 1 a 0 b 0 0 C N-1 C 1 + + + C 0 S N-1 a och b ansluter till heladderarna utifrån. c kommer från annan heladderare. Gör förbearbetning, utanför kritiska vägen: Generate (a b) och Propagate (a + b) S 1 S 0 Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 31 Använda P och G i en krets P P G G Färre transistorer ger lägre grindfördröjning. G = ab P = a + b Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 32 16
En ny operator, istället för + (G 1, P 1 ) (G 0, P 0 ) (G 0 + P 0 G 1, P 0 P 1 ) Den s.k. dot-operatorn ger oss möjlighet att bygga associativa funktioner. Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 33 Exempel på addition En 4-bitars addition: (C 3 = G 3, P 3 ) (G 2, P 2 ) (C 2 = G 2 + P 2 G 3, P 2 P 3 ) C 1 = G 1 + P 1 (G 2 + P 2 G 3 ) P 1 P 2 P 3 (G 1, P 1 ) (G 0, P 0 ) C 0 = [G 0 + P 0 G 1 ] + [P 0 P 1 ] (G 2 + P 2 G 3 ) P 0 P 1 P 2 P 3 (G 0 + P 0 G 1, P 0 P 1 ) Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 34 17
64-bitars processoradderare g i = a i & b i old (g i, p i ) (g x, p x ), där x = i+1, i+2, i+4,... s i = x i-1 XOR nyast g i p = a b i i i newg =old (oldp &g position 0 i g i i x ) utom: s 0 =nyastg 0 position 63 x i = a i XOR b MSB i new (g i, p i ) new p i = old p i & p x utom: s 64 = x 63 LSB s 0 s 10 s 20 s 30 s 40 s 50 s 60 s 64 Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 35 Logikdjup = 8 (jfr. 64 för RCA) g i = a i & b i old (g i, p i ) (g x, p x ), där x = i+1, i+2, i+4,... s i = x i-1 XOR nyast g i p = a b i i i newg =old (oldp &g position 0 i g i i x ) utom: s 0 =nyastg 0 position 63 x i = a i XOR b MSB i new (g i, p i ) new p i = old p i & p x utom: s 64 = x 63 LSB s 0 s 10 s 20 s 30 s 40 s 50 s 60 s 64 Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 36 18
Extra snabb krets för processoradderare φ φ φ G Gi Pi G φ G Gi Pi G a φ b Pi Gi Gi Pi Pi Gi Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 37 Kretsschema för en cell Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 38 19
Kretslayout för en cell Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 39 Två 32-bitars adderare Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 40 20
Skiss på 16-bitars multiplikator Multiplikation i hårdvara Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 41 Layout av 16-bitars multiplikator Multiplikation i hårdvara Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 42 21
Avslutning Många konstruktionsalternativ! Olika teknologiplattformar: ASIC FPGA Standardkomponenter Olika konstruktionsmetoder: kti t Manuell design för regelbundna block Automatisk (CAD-stöd) för oregelbundna block Digital- och datorteknik, 081126, Per Larsson-Edefors Sida 43 22