Solutions - Homework 4 (Due date: November 9:30 am) Presentation and clarity are very important!

Size: px
Start display at page:

Download "Solutions - Homework 4 (Due date: November 9:30 am) Presentation and clarity are very important!"

Transcription

1 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 Solutions - Homework 4 (Due date: November 9:3 am) Presentation and clarity are very important! PROBLM ( PTS) Digital Stopwatch: The architecture of a digital stopwatch is provided. We require counters with an output ''. This output is asserted (for one clock cycle) when the counter reaches its maximum count. Counter (.s). It counts up to, asserting '' when the count reaches. For an input clock frequency of MH, '' is asserted every. s. BCD counter: It counts up to 9, asserting '' when the count reaches 9. Modulo-6 counter: It counts up to 5, asserting '' when the count reaches 5. NXYS3 implementation details: Only one 7-segment display can be used at a time we serialie the four BCD outputs. In order for each digit to appear bright and continuously illuminated, we illuminate each digit for only ms every 4 ms. This is taken care of feeding the output of the counter to.s to the enable input of the FSM. pause Counter (.s) resetn Counter modulo-6 BCD counter BCD counter BCD counter clock segment Decoder Counter (.s) N(3) N() N() N() N 4 -to-4 decoder s FSM Provide the Finite State Machine of the serialier in ASM (Algorithmic State Machine) form. Provide the VHDL description of the entire circuit: FSM + Datapath circuit. Tip: If you want to simulate your circuit, do not include the Counter to.s and the Counter to.s (instead, set the output signal to ). Otherwise, you might not be able to simulate your circuit.

2 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 FSM (ASM chart): S resetn= s S s S3 s S4 s VHDL code: 'dig_stopwatch.vhd' library I; use I.STD_LOGIC_64.ALL; use ieee.math_real.log; use ieee.math_real.ceil; entity dig_stopwatch is port (resetn, clock, pause: in std_logic; segs: out std_logic_vector (6 downto ); N: out std_logic_vector (3 downto )); end dig_stopwatch; architecture Behavioral of dig_stopwatch is component my_genpulse generic (COUNT: INTGR:= (**8)/); -- (**8)/ cycles of T = ns -->.5 s port (clock, resetn, : in std_logic; Q: out std_logic_vector ( integer(ceil(log(real(count)))) - downto ); : out std_logic); end component; component sevenseg port (bcd: in std_logic_vector (3 downto ); sevseg: out std_logic_vector (6 downto ); N: out std_logic_vector(3 downto )); end component; signal npause,, _, _, _, _3,_, _,_3: std_logic; signal omux, Q_, Q_, Q_, Q_3: std_logic_vector (3 downto ); signal s: std_logic_vector ( downto ); signal _fsm: std_logic; type state is (S, S, S3, S4); signal y: state; npause <= not (pause); Q_3(3) <= ''; -- Counter:.s g: my_genpulse generic map (COUNT => **6) port map (clock => clock, resetn => resetn, => npause, => ); -- Counter: g: my_genpulse generic map (COUNT => ) port map (clock => clock, resetn => resetn, =>, Q => Q_, => _);

3 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 -- Counter: g: my_genpulse generic map (COUNT => ) port map (clock => clock, resetn => resetn, => _, Q => Q_, => _); _ <= and _; -- Counter: g: my_genpulse generic map (COUNT => ) port map (clock => clock, resetn => resetn, => _, Q => Q_, => _); _ <= _ and _; -- Counter: 6 g3: my_genpulse generic map (COUNT => 6) port map (clock => clock, resetn => resetn, => _3, Q => Q_3 ( downto ), => _3); _3 <= _ and _; -- Multiplexor with s select omux <= Q_ when "", Q_ when "", Q_ when "", Q_3 when others; seg7: sevenseg port map (bcd => omux, sevseg => segs); -- -to-4 decoder with s select N <= "" when "", "" when "", "" when "", "" when "", "" when others; -- Counter:.s gfsm: my_genpulse generic map (COUNT => **5) port map (clock => clock, resetn => resetn, => '', => _fsm); Transitions: process (resetn, clock, _fsm) if resetn = '' then -- asynchronous signal y <= S; -- if resetn asserted, go to initial state: S elsif (clock'event and clock = '') then if _fsm = '' then case y is when S => y <= S; when S => y <= S3; when S3 => y <= S4; when S4 => y <= S; end case; end process; Outputs: process (y) case y is when S => s <= ""; when S => s <= ""; when S3 => s <= ""; when S4 => s <= ""; end case; end process; end Behavioral;

4 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 PROBLM (5 PTS) Design of a configurable lights pattern generator. sel: selects the pattern. stop: freees the pattern when stop=. Two 7-segment displays are used. The datapath circuit is provided. Input x : Selects the rate at which the lights pattern change (every.5,.,.5, or.5 seconds) sel segs[7..] : sel x stop resetn clock? 8 segs resetn clock Q?? counter (.5s) Q?? x stop sel FINIT STAT MACHIN dseg 8 sg D Q On the NXYS3, only one 7-segment display can be used at a time 7 counter (.s) 3 Counter (.s) Q?? FINIT STAT MACHIN s -to- decoder buf buf() buf() counter (.5s) Q?? x = Lights change every.5 s x = Lights change every. s x = Lights change every.5 s x = Lights change every.5 s counter (.5s) Provide both Finite State Machines in ASM form. ASM: Algorithmic State Machine. Provide the VHDL description of the entire circuit: FSMs + Datapath circuit.

5 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 Main FSM (ASM chart): S resetn= sel dseg, sg dseg, sg dseg, sg dseg, sg Sa Sb Sc Sd dseg, sg dseg, sg dseg, sg dseg, sg S3a S3b S3c S3d dseg, sg dseg, sg dseg, sg dseg, sg S4a S4b S4c S4d dseg, sg dseg, sg dseg, sg dseg, sg S5a S5d dseg, sg S6a dseg, sg dseg, sg S6d dseg, sg S8a S7a dseg, sg dseg, sg

6 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 FSM for 7-segment display control (ASM chart): S s resetn= S s VHDL code: 'lights_pattern.vhd' library I; use I.STD_LOGIC_64.ALL; use ieee.math_real.log; use ieee.math_real.ceil; entity lights_pattern is port (resetn, clock, stop: in std_logic; x, sel: in std_logic_vector ( downto ); segs: out std_logic_vector (6 downto ); N: out std_logic_vector (3 downto )); end lights_pattern; architecture Behavioral of lights_pattern is component my_genpulse generic (COUNT: INTGR:= (**8)/); -- (**8)/ cycles of T = ns -->.5 s port (clock, resetn, : in std_logic; Q: out std_logic_vector ( integer(ceil(log(real(count)))) - downto ); : out std_logic); end component; component my_rege generic (N: INTGR:= 4); port ( clock, resetn: in std_logic;, sclr: in std_logic; -- sclr: Synchronous clear D: in std_logic_vector (N- downto ); Q: out std_logic_vector (N- downto )); end component; type state is (S,Sa,S3a,S4a,S5a,S6a,S7a,S8a,Sb,S3b,S4b,Sc,S3c,S4c,Sd,S3d,S4d,S5d,S6d); signal y: state; type stateo is (S, S); signal yo: stateo; signal _fsm,, sg, a, b, c, d,, s: std_logic; signal dseg, seg: std_logic_vector (7 downto ); signal psegs: std_logic_vector (6 downto ); -- Counter:.5 s ga: my_genpulse generic map (COUNT => 3*((**8)/)) port map (clock => clock, resetn => resetn, => '', => a); -- Counter:. s gb: my_genpulse generic map (COUNT => **8) port map (clock => clock, resetn => resetn, => '', => b); -- Counter:.5 s gc: my_genpulse generic map (COUNT => (**8)/) port map (clock => clock, resetn => resetn, => '', => c); -- Counter:.5 s gd: my_genpulse generic map (COUNT => (**8)/4) port map (clock => clock, resetn => resetn, => '', => d);

7 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 -- Multiplexor for the counter outputs: with x select <= a when "", b when "", c when "", d when others; <= and not(stop); -- 8-bit register rp: my_rege generic map (N => 8) port map (clock => clock, resetn => resetn, => sg, sclr => '', D => dseg, Q => seg); -- Multiplexor for the 7-segment displays: with s select psegs <= seg(6 downto 3)&"" when '', seg(7)&""&seg( downto )&'' when others; -- segs: a b c d e f g segs <= not(psegs); -- Active-low outputs -- Counter:. s gfsm: my_genpulse generic map (COUNT => **5) port map (clock => clock, resetn => resetn, => '', => _fsm); -- -to- decoder with s select N <= "" when '', "" when others; -- Main FSM: Transitions: process (resetn, clock,, sel) if resetn = '' then -- asynchronous signal y <= S; -- if resetn asserted, go to initial state: S elsif (clock'event and clock = '') then case y is when S => if = '' then case sel is when "" => y <= Sa; when "" => y <= Sb; when "" => y <= Sc; when others => y <= Sd; end case; else y <= S; end process; when Sa => if = '' then y <= S3a; else y <= Sa; when S3a => if = '' then y <= S4a; else y <= S3a; when S4a => if = '' then y <= S5a; else y <= S4a; when S5a => if = '' then y <= S6a; else y <= S5a; when S6a => if = '' then y <= S7a; else y <= S6a; when S7a => if = '' then y <= S8a; else y <= S7a; when S8a => if = '' then y <= S; else y <= S8a; when Sb => if = '' then y <= S3b; else y <= Sb; when S3b => if = '' then y <= S4b; else y <= S3b; when S4b => if = '' then y <= S; else y <= S4b; when Sc => if = '' then y <= S3c; else y <= Sc; when S3c => if = '' then y <= S4c; else y <= S3c; when S4c => if = '' then y <= S; else y <= S4c; when Sd => if = '' then y <= S3d; else y <= Sd; when S3d => if = '' then y <= S4d; else y <= S3d; when S4d => if = '' then y <= S5d; else y <= S4d; when S5d => if = '' then y <= S6d; else y <= S5d; when S6d => if = '' then y <= S; else y <= S6d; end case;

8 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 Outputs: process (y,, sel) -- Initialiation of FSM outputs: dseg <= (others => ''); sg <= ''; case y is when S => if = '' then case sel is when "" => dseg <= ""; sg <= ''; when "" => dseg <= ""; sg <= ''; when "" => dseg <= ""; sg <= ''; when others => dseg <= ""; sg <= ''; end case; when Sa => if = '' then dseg <= ""; sg <= ''; when S3a => if = '' then dseg <= ""; sg <= ''; when S4a => if = '' then dseg <= ""; sg <= ''; when S5a => if = '' then dseg <= ""; sg <= ''; when S6a => if = '' then dseg <= ""; sg <= ''; when S7a => if = '' then dseg <= ""; sg <= ''; when S8a => if = '' then dseg <= ""; sg <= ''; when Sb => if = '' then dseg <= ""; sg <= ''; when S3b => if = '' then dseg <= ""; sg <= ''; when S4b => if = '' then dseg <= ""; sg <= ''; when Sc => if = '' then dseg <= ""; sg <= ''; when S3c => if = '' then dseg <= ""; sg <= ''; when S4c => if = '' then dseg <= ""; sg <= ''; when Sd => if = '' then dseg <= ""; sg <= ''; when S3d => if = '' then dseg <= ""; sg <= ''; when S4d => if = '' then dseg <= ""; sg <= ''; when S5d => if = '' then dseg <= ""; sg <= ''; when S6d => if = '' then dseg <= ""; sg <= ''; end case; end process; -- FSM: serialier for the 7-segment display Trans: process (resetn, clock, _fsm) if resetn = '' then -- asynchronous signal yo <= S; -- if resetn asserted, go to initial state: S elsif (clock'event and clock = '') then if _fsm = '' then case yo is when S => yo <= S; when S => yo <= S; end case; end process; Outps: process (yo) case yo is when S => s <= ''; when S => s <= ''; end case; end process; end Behavioral;

9 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 PROBLM 3 ( PTS) The figure depicts the architecture of a simple processor. Data_in n D Q n Data BUS R R R R3 A B _R O_R _R O_R _R O_R _R3 O_R3 _A op ALU s_l G din 4 left-shift _G L_G O_G _ext w fun 7 CONTROL CIRCUIT done Register G: Parallel Access left-shift register with enable. s_l = Load, s_l = Left-shift The figure below depicts the datapath and the FSM of the Control Circuit: funq = f f f Ry Ry Rx Rx fun _fun 7 D Q 7 Ry Rx funq so Rx Rx x o DCODR with enable DCODR with enable 3 3 _R _R _R _R3 O_R O_R O_R O_R3 w f 3 _fun x o so _A L_G _G FSM op 4 O_G _ext done

10 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 The following table specifies the behavior of the Arithmetic-Logic Unit (ALU). This ALU is purely combinatorial. op Operation Function Unit y <= A Transfer A y <= A + Increment A y <= A - Decrement A y <= B Transfer B y <= B + Increment B Arithmetic y <= B Decrement B y <= A + B Add A and B y <= A B Subtract B from 'A' y <= not A y <= not B y <= A AND B y <= A OR B y <= A NAND B y <= A NOR B y <= A XOR B y <= A XNOR B Complement A Complement B AND OR NAND NOR XOR XNOR Logic Operation: very time w = '', we store the input, then proceed to execute it. The 7 bits of the stored input, called, are arranged as: =. The first 3 bits specify the operation, while the other 4 bits specify the registers over which the operations are applied. f Operation Function Load Rx, Data Rx Data Add Rx, Data Rx Rx + Data Not Rx Rx NOT (Rx) Sub Rx, Ry Rx Rx - Ry Add Rx, Ry Rx Rx + Ry Move Rx, Ry Rx Ry sla Rx Rx left-shift Rx Addi Rx, Rx Rx + Design the Finite State Machine (provide it in ASM form) that can issue the correct set of signals for all the listed operations.

11 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 FSM (ASM chart): S resetn= w S _fun _ext, x done f o, so _A o, so _G,L_G op o, so _A o, so _A o, x done o, so _G,L_G op o, so _G,L_G op S3a _ext _G,L_G op S4a O_G, x done S5a o _G,L_G op S6a o _G,L_G op S7a _G L_G S8a _G,L_G O_G op S3b S5b S6b S7b S8b O_G, x done O_G, x done O_G, x done O_G, x done O_G, x done PROBLM 4 ( PTS) A B C For the following error-detection system, provide the truth table and sketch the circuits of i) the Odd Parity Generator, and ii) Odd parity checker. Transmitted bits A B C Odd Parity Generator TPB Odd Parity Checker RPB Odd parity generator: TPB is such that A B C TPB has an odd number of bits. Odd parity checker: Checks whether A B C TPB has an odd number of bits. If this is the case, RPB = '', otherwise RPB = '' (signaling an error).

12 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 Odd Parity Generator A B C A B C TPB TPB Odd Parity Checker A B C TPB RPB A B C TPB RPB Sketch the schematics of an n-bit comparator of two numbers represented in s complement. Required outputs: AgeB, AlB, AeB. If A >= B AgeB =. If A < B AlB =. If A = B AeB =. You can use adders (specify the number of bits) and XOR gates. Make sure that your circuit works in all circumstances (consider that A and B may cause overflow, you need to avoid it). A n- A B n n n+ n+ A n- B n- A n- B n-... A B A B A B B n- c out c n FA c n- FA c n-... c 3 FA c FA c FA c c in s n s n- s s s s n = A-B s n = A-B <... AlB AgeB AeB

13 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 PROBLM 5 (5 PTS) LUT connected to a bidirectional port: An LUT4-to- (also called LUT4) can implement a 4-input function. The VHDL code is provided below. Note that the values stored in the LUT are constant, hence those values are entered as a parameter in the VHDL code: library I; use I.STD_LOGIC_64.ALL; entity my4tolut is generic (data: std_logic_vector(5 downto ):=x"fab"); -- LUT 4-to- contents port ( ILUT: in std_logic_vector (3 downto ); OLUT: out std_logic); end my4tolut; architecture Behavioral of my4tolut is with ILUT select OLUT <= data() when "", data() when "", data() when "", data(3) when "", data(4) when "", data(5) when "", data(6) when "", data(7) when "", data(8) when "", data(9) when "", data() when "", data() when "", data() when "", data(3) when "", data(4) when "", data(5) when "", '' when others; end Behavioral; 4-to- Look-up Table (Read-only memory with 6 positions) ILUT address data() data() data() data(3) data(4) data(5) 4 data(6) OLUT data(7) data(8) data(9) data() data() data() data(3) data(4) data(5) LUTs with more than four inputs can be built by grouping several LUT 4-to- and MUXs. The figure below shows how an LUT 6-to- can be built. An LUT with more than one output can also be built. The figure below show how we can create an LUT 6-to-6 (we just use six LUT 6-to-). LI 6 MSBs 4 LSBs LI(3..) LUT4 LUT4 LUT4 LUT4 LI(4) MUX MUX LI(5) MUX LUT5-to- LUT6-to LUT 6 to LUT 6 to... LUT 6 to b 5 b 5 b b b 4 b LUT 6-to words of 6 bits column 5 6 bits column column LUT 6-to-6 6 You are asked to design a system with an LUT 6-to-6. This will be accomplished in a series of steps: Provide the VHDL code of an LUT 6-to-. You can built it by i) grouping four LUT4-to- and MUXs, or ii) using only one VHDL file (similar to my4tolut.vhd). The entity should look like this: entity my6tolut is generic (data: std_logic_vector(63 downto ):=x"fab97ca39cc"); values port ( ILUT: in std_logic_vector (5 downto ); OLUT: out std_logic); end my6tolut;

14 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 Write the VHDL code for an LUT 6-to-6. You must built it by grouping six LUT 6-to-. The entity should look like this: entity my6to6lut is generic (data5: std_logic_vector(63 downto ):=x"fab97ca39cc"; -- column 5 data4: std_logic_vector(63 downto ):=x"aabbccff9998a"; -- column 4 data3: std_logic_vector(63 downto ):=x"595bbcafdada"; -- column 3 data: std_logic_vector(63 downto ):=x"fac9933cab"; -- column data: std_logic_vector(63 downto ):=x"dcaffff9a3"; -- column data: std_logic_vector(63 downto ):=x"acad4baf5"); -- column port ( ILUT: in std_logic_vector (5 downto ); OLUT: out std_logic_vector (5 downto )); end my6to6lut; Important: When instantiating the my6tolut component, we use the port map instruction to make interconnections. Now, we also need to provide the correct parameter to each my6tolut component. This is done usually the generic map instruction. Final System: Provide the VHDL code of the circuit depicted below. Use the Structural Description by interconnecting the following components: i) LUT 6-to-6, ii) 6-bit register, and iii) Tri-state buffers. Important: The port 'DATA' can be input or output at different times. Use INOUT in your VHDL code. LUT6-to-6 contents: We want this LUT 6-to-6 to provide the following function: =. xample: =35 = 35. =3 Compute the contents of the LUT 6-to-6 and provide each column in hexadecimal format as: data5, data4, data3, data, data, data (generic input parameters) Complete the Timing diagram shown below. Note that the port DATA is input at some times, and output at other times. resetn clk DI 6 D Q 6 6 LUT 6-to-6 DO 6 DATA O clk resetn O DATA DI DO

15 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 LUT6-to-6 contents: LUT 6-to-6: hexadecimals converted in this direction b 5 b 4 b 3 b b b C A F C A F 8 6 F 9 5 C A F F F D F F C A F F 9 5 C B F F F 9 F F C F F 9 5 F C A F F data5 data4 data3 data data data VHDL code: 'syslut6to6.vhd' library I; use I.STD_LOGIC_64.ALL; entity syslut6to6 is generic (data5: std_logic_vector(63 downto ):=x"ffffffc"; -- column 5 data4: std_logic_vector(63 downto ):=x"fc3ffffc"; -- column 4 data3: std_logic_vector(63 downto ):=x"3ff3ff3ff"; -- column 3 data: std_logic_vector(63 downto ):=x"83ef83ef83ef"; -- column data: std_logic_vector(63 downto ):=x"639ce739ce7398cc"; -- column data: std_logic_vector(63 downto ):=x"5a596b5ad6a56aa"); -- column port (clk, resetn, O: in std_logic; data: inout std_logic_vector (5 downto )); end syslut6to6; architecture structure of syslut6to6 is component my_rege generic (N: INTGR:= 4); port ( clock, resetn: in std_logic;, sclr: in std_logic; -- sclr: Synchronous clear D: in std_logic_vector (N- downto ); Q: out std_logic_vector (N- downto )); end component; component my6to6lut generic (data5: std_logic_vector(63 downto ):=x"fab97ca39cc"; -- column 5 data4: std_logic_vector(63 downto ):=x"aabbccff9998a"; -- column 4 data3: std_logic_vector(63 downto ):=x"595bbcafdada"; -- column 3 data: std_logic_vector(63 downto ):=x"fac9933cab"; -- column data: std_logic_vector(63 downto ):=x"dcaffff9a3"; -- column data: std_logic_vector(63 downto ):=x"acad4baf5"); -- column port ( ILUT: in std_logic_vector (5 downto ); OLUT: out std_logic_vector (5 downto )); end component; signal DI, DO, QR: std_logic_vector (5 downto ); ri: my_rege generic map (N => 6) port map (clock => clk, resetn => resetn, => O, sclr => '', D => DI, Q => QR); LUT6to6: my6to6lut generic map (data5 => data5, data4 => data4, data3 => data3, data => data, data => data, data => data) port map (ILUT => QR, OLUT => DO); DATA <= DO when O = '' else (others => 'Z'); DI <= DATA when O = '' else (others => 'Z'); end structure;

16 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 VHDL code: 'my6to6lut' library I; use I.STD_LOGIC_64.ALL; entity my6to6lut is generic (data5: std_logic_vector(63 downto ):=x"fab97ca39cc"; -- column 5 data4: std_logic_vector(63 downto ):=x"aabbccff9998a"; -- column 4 data3: std_logic_vector(63 downto ):=x"595bbcafdada"; -- column 3 data: std_logic_vector(63 downto ):=x"fac9933cab"; -- column data: std_logic_vector(63 downto ):=x"dcaffff9a3"; -- column data: std_logic_vector(63 downto ):=x"acad4baf5"); -- column port ( ILUT: in std_logic_vector (5 downto ); OLUT: out std_logic_vector (5 downto )); end my6to6lut; architecture Behavioral of my6to6lut is component my6tolut generic (data: std_logic_vector(63 downto ):=x"accabbfacfab"); port ( ILUT: in std_logic_vector (5 downto ); OLUT: out std_logic); end component; signal OLUT_l, OLUT_h: std_logic; -- 6-to- LUT holding contents of column 5: r5: my6tolut generic map (data => data5) port map (ILUT => ILUT, OLUT => OLUT(5)); -- 6-to- LUT holding contents of column 4: r4: my6tolut generic map (data => data4) port map (ILUT => ILUT, OLUT => OLUT(4)); -- 6-to- LUT holding contents of column 3: r3: my6tolut generic map (data => data3) port map (ILUT => ILUT, OLUT => OLUT(3)); -- 6-to- LUT holding contents of column : r: my6tolut generic map (data => data) port map (ILUT => ILUT, OLUT => OLUT()); -- 6-to- LUT holding contents of column : r: my6tolut generic map (data => data) port map (ILUT => ILUT, OLUT => OLUT()); -- 6-to- LUT holding contents of column : r: my6tolut generic map (data => data) port map (ILUT => ILUT, OLUT => OLUT()); end Behavioral; VHDL code: 'my6tolut' library I; use I.STD_LOGIC_64.ALL; entity my6tolut is generic (data: std_logic_vector(63 downto ):=x"accabbfacfab"); port ( ILUT: in std_logic_vector (5 downto ); OLUT: out std_logic); end my6tolut; architecture Behavioral of my6tolut is component my5tolut generic (data: std_logic_vector(3 downto ):=x"facfab"); port ( ILUT: in std_logic_vector (4 downto ); OLUT: out std_logic); end component; signal OLUT_l, OLUT_h: std_logic; -- 5-to- LUT holding contents: data(3 downto ) rl: my5tolut generic map (data => data(3 downto )) port map (ILUT => ILUT(4 downto ), OLUT => OLUT_l); -- 5-to- LUT holding contents: data(63 downto 3) rh: my5tolut generic map (data => data (63 downto 3)) port map (ILUT => ILUT(4 downto ), OLUT => OLUT_h); with ILUT(5) select OLUT <= OLUT_l when '', OLUT_h when others; end Behavioral;

17 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 VHDL code: 'my5tolut' library I; use I.STD_LOGIC_64.ALL; entity my5tolut is generic (data: std_logic_vector(3 downto ):=x"facfab"); port ( ILUT: in std_logic_vector (4 downto ); OLUT: out std_logic); end my5tolut; architecture Behavioral of my5tolut is component my4tolut generic (data: std_logic_vector(5 downto ):=x"fab"); port ( ILUT: in std_logic_vector (3 downto ); OLUT: out std_logic); end component; signal OLUT_l, OLUT_h: std_logic; -- 4-to- LUT holding contents: data(5 downto ) rl: my4tolut generic map (data => data(5 downto )) port map (ILUT => ILUT(3 downto ), OLUT => OLUT_l); -- 4-to- LUT holding contents: data(3 downto 6) rh: my4tolut generic map (data => data (3 downto 6)) port map (ILUT => ILUT(3 downto ), OLUT => OLUT_h); with ILUT(4) select OLUT <= OLUT_l when '', OLUT_h when others; end Behavioral; VHDL Testbench LIBRARY ieee; US ieee.std_logic_64.all; use ieee.std_logic_arith.all; NTITY tb_syslut6to6 IS ND tb_syslut6to6; ARCHITCTUR behavior OF tb_syslut6to6 IS BGIN -- Component Declaration for the Unit Under Test (UUT) COMPONNT syslut6to6 PORT (clk : IN std_logic; resetn : IN std_logic; O : IN std_logic; data : INOUT std_logic_vector(5 downto )); ND COMPONNT; --Inputs signal clk : std_logic := ''; signal resetn : std_logic := ''; signal O : std_logic := ''; --BiDirs signal data : std_logic_vector(5 downto ); -- Clock period definitions constant clk_period : time := ns; -- Instantiate the Unit Under Test (UUT) uut: syslut6to6 PORT MAP (clk => clk, resetn => resetn, O => O, data => data); -- Clock process definitions clk_process :process clk <= ''; wait for clk_period/; clk <= ''; wait for clk_period/; end process;

18 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 ND; -- Stimulus process stim_proc: process -- hold reset state for ns. resetn <= ''; DATA <= "ZZZZZZ"; wait for ns; resetn <= ''; wait for clk_period; O <= ''; DATA <= ""; wait for *clk_period; O <= ''; DATA <= "ZZZZZZ"; wait for *clk_period; O <= ''; DATA <= ""; wait for *clk_period; O <= ''; DATA <= "ZZZZZZ"; wait for *clk_period; O <= ''; DATA <= ""; wait for *clk_period; O <= ''; DATA <= "ZZZZZZ"; wait for *clk_period; O <= ''; DATA <= ""; wait for *clk_period; O <= ''; DATA <= "ZZZZZZ"; wait for *clk_period; wait for 4*clk_period; O <= ''; lp: for i in to 63 loop DATA <= conv_std_logic_vector(i,6); wait for clk_period; end loop; end process; Timing diagram: clk resetn O DATA DI DO XTRA CRDIT (+ PTS) Demonstrate the circuits of Problems and working on the NXYS3 board. UCF File for Problem : 'dig_stopwatch.ucf' # Inputs NT "clock" LOC = "V"; NT "resetn" LOC = "T"; #SW NT "pause" LOC = "T9"; #SW # Outputs NT "N<3>" LOC = "P7"; # anode (st display from left to right) NT "N<>" LOC = "P8"; # anode (nd display from left to right) NT "N<>" LOC = "N5"; # anode (3rd display from left to right) NT "N<>" LOC = "N6"; # anode (4th display from left to right) NT "segs<6>" LOC = "T7"; # a NT "segs<5>" LOC = "T8"; # b NT "segs<4>" LOC = "U7"; # c NT "segs<3>" LOC = "U8"; # d NT "segs<>" LOC = "M4"; # e NT "segs<>" LOC = "N4"; # f NT "segs<>" LOC = "L4"; # g

19 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 UCF File for Problem : 'lights_pattern.ucf' # Inputs NT "clock" LOC = "V"; NT "resetn" LOC = "T5"; #SW7 NT "stop" LOC = "B8"; #BTNS (center) NT "x<>" LOC = "T9"; # SW NT "x<>" LOC = "T"; # SW NT "sel<>" LOC = "M8"; # SW3 NT "sel<>" LOC = "V9"; # SW # Outputs NT "N<3>" LOC = "P7"; # anode (st display from left to right) NT "N<>" LOC = "P8"; # anode (nd display from left to right) NT "N<>" LOC = "N5"; # anode (3rd display from left to right) NT "N<>" LOC = "N6"; # anode (4th display from left to right) NT "segs<6>" LOC = "T7"; # a NT "segs<5>" LOC = "T8"; # b NT "segs<4>" LOC = "U7"; # c NT "segs<3>" LOC = "U8"; # d NT "segs<>" LOC = "M4"; # e NT "segs<>" LOC = "N4"; # f NT "segs<>" LOC = "L4"; # g APPNDIX: XTRA VHDL FILS VHDL code: 'my_genpulse.vhd' library I; use I.STD_LOGIC_64.ALL; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; use ieee.math_real.log; use ieee.math_real.ceil; entity my_genpulse is generic (COUNT: INTGR:= (**8)/); -- (**8)/ cycles of T = ns -->.5 s port (clock, resetn, : in std_logic; Q: out std_logic_vector ( integer(ceil(log(real(count)))) - downto ); : out std_logic); end my_genpulse; architecture Behavioral of my_genpulse is constant nbits: INTGR:= integer(ceil(log(real(count)))); signal Qt: std_logic_vector (nbits - downto ); process (resetn, clock) if resetn = '' then Qt <= (others => ''); elsif (clock'event and clock = '') then if = '' then if Qt = conv_std_logic_vector (COUNT-,nbits) then Qt <= (others => ''); else Qt <= Qt + conv_std_logic_vector (,nbits); end process; <= '' when Qt = conv_std_logic_vector (COUNT-,nbits) else ''; Q <= Qt; end Behavioral;

20 DPARTMNT OF LCTRICAL AND COMPUTR NGINRING, TH UNIVRSITY OF NW MXICO C-38L: Computer Logic Design Fall 3 VHDL code: 'my_rege' library I; use I.STD_LOGIC_64.ALL; -- N-bit Register -- = '', sclr = '' --> Input data 'D' is copied on Q -- = '', sclr = '' --> Q is cleared () entity my_rege is generic (N: INTGR:= 4); port ( clock, resetn: in std_logic;, sclr: in std_logic; -- sclr: Synchronous clear D: in std_logic_vector (N- downto ); Q: out std_logic_vector (N- downto )); end my_rege; architecture Behavioral of my_rege is signal Qt: std_logic_vector (N- downto ); process (resetn, clock) if resetn = '' then Qt <= (others => ''); elsif (clock'event and clock = '') then if = '' then if sclr = '' then Qt <= (others => ''); else Qt <= D; end process; Q <= Qt; end Behavioral; VHDL code: 'sevenseg.vhd' library I; use I.STD_LOGIC_64.ALL; entity sevenseg is port (bcd: in std_logic_vector (3 downto ); sevseg: out std_logic_vector (6 downto ); N: out std_logic_vector(3 downto )); end sevenseg; architecture structure of sevenseg is signal leds: std_logic_vector (6 downto ); -- a b c d e f g -- leds6 leds5 leds4 leds3 leds leds leds with bcd select leds <= "" when "", "" when "", "" when "", "" when "", "" when "", "" when "", "" when "", "" when "", "" when "", "" when "", " " when others; -- There are 4 7-seg displays that can be used. We will use only the first (from left to right): N <= ""; -- only the first 7-seg display is activated. -- N(3) goes to one 7-seg display. It goes to every LD anode. -- To provide a logic '' to the anode, we need N(3) to be ero (see circuit) sevseg <= not(leds); end structure;

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs IGITAL LOGIC SIGN VHL Coding for FPGAs SUNTIAL CIRCUITS Unit 5 Asynchronous sequential circuits: Latches Synchronous circuits: flip flops, counters, registers. Testbench: Generating stimulus COMBINATIONAL

More information

Solutions - Homework 2 (Due date: October 9:30 am) Presentation and clarity are very important!

Solutions - Homework 2 (Due date: October 9:30 am) Presentation and clarity are very important! ECE-8L: Computer Logic Design Fall Solutions - Homework (Due date: October rd @ 9: am) Presentation and clarit are ver important! PROBLEM ( PTS) Complete the following table. Use the fewest number of bits

More information

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines Algorithmic State Machine (ASM) charts FINITE STATE MACHINES (FSMs) Classification: Moore Machine:

More information

EENG 2910 Project III: Digital System Design. Due: 04/30/2014. Team Members: University of North Texas Department of Electrical Engineering

EENG 2910 Project III: Digital System Design. Due: 04/30/2014. Team Members: University of North Texas Department of Electrical Engineering EENG 2910 Project III: Digital System Design Due: 04/30/2014 Team Members: University of North Texas Department of Electrical Engineering Table of Content i Contents Abstract...3 Introduction...3 Report...4

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines FINITE STATE MACHINES (FSMs) Classification: Moore Machine: Outputs depend only on the current state

More information

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University Hardware description language (HDL) Intended to describe circuits textually, for a computer to read Evolved starting in the 1970s and 1980s Popular languages today include: VHDL Defined in 1980s by U.S.

More information

Hardware Description Language VHDL (1) Introduction

Hardware Description Language VHDL (1) Introduction Hardware Description Language VHDL (1) Introduction Digital Radiation Measurement and Spectroscopy NE/RHP 537 Introduction Hardware description language (HDL) Intended to describe circuits textually, for

More information

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 8

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 8 DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 8 PARAMETRIC CODING Techniques: generic input size, for-generate, if-generate, conv_integer. Custom-defined arrays, functions, and packages. Examples: vector

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 2

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 2 DIGITAL LOGIC WITH VHDL (Fall 23) Unit 2 Use of std_logic_vector. CONCURRENT DESCRIPTION with-select, when-else statements Examples: multiplexor, decoder. std_logic_vector In the example, we use the std_logic_vector

More information

[VARIABLE declaration] BEGIN. sequential statements

[VARIABLE declaration] BEGIN. sequential statements PROCESS statement (contains sequential statements) Simple signal assignment statement

More information

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated. 8-1 Name Binary code IDLE 000 Register operation or output R 0 RUN 0 1 Condition (a) State box (b) Example of state box (c) Decision box IDLE R 0 From decision box 0 1 START Register operation or output

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1 DIGITAL LOGIC WITH VHDL (Fall 23) Unit DESIGN FLOW DATA TYPES LOGIC GATES WITH VHDL TESTBENCH GENERATION DESIGN FLOW Design Entry: We specify the logic circuit using a Hardware Description Language (e.g.,

More information

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents VHDL Testbench Tutorial 1 Contents 1 VHDL Testbench 2 Test Bench Syntax 3 Testbench Example: VHDL Code for Up Down Binary Counter 4 VHDL Testbench code for up down binary counter 5 Testbench Waveform for

More information

Lab 3: Standard Combinational Components

Lab 3: Standard Combinational Components Lab 3: Standard Combinational Components Purpose In this lab you will implement several combinational circuits on the DE1 development board to test and verify their operations. Introduction Using a high-level

More information

ELCT 501: Digital System Design

ELCT 501: Digital System Design ELCT 501: Digital System Lecture 4: CAD tools (Continued) Dr. Mohamed Abd El Ghany, Basic VHDL Concept Via an Example Problem: write VHDL code for 1-bit adder 4-bit adder 2 1-bit adder Inputs: A (1 bit)

More information

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers ECE 545 Lecture 12 Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts Required reading P. Chu, using VHDL Chapter 1, Finite State Machine: Principle & Practice Chapter

More information

Control and Datapath 8

Control and Datapath 8 Control and Datapath 8 Engineering attempts to develop design methods that break a problem up into separate steps to simplify the design and increase the likelihood of a correct solution. Digital system

More information

EEL 4712 Digital Design Test 1 Spring Semester 2008

EEL 4712 Digital Design Test 1 Spring Semester 2008 IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. Also, as always, the best answer gets the most points. COVER SHEET: Problem:

More information

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 6, 2006 Classes November 6 and 8 are in 429 Dana! Lecture 15: Homework 5: Datapath How to write a testbench for synchronous

More information

Contents. Chapter 9 Datapaths Page 1 of 28

Contents. Chapter 9 Datapaths Page 1 of 28 Chapter 9 Datapaths Page of 2 Contents Contents... 9 Datapaths... 2 9. General Datapath... 3 9.2 Using a General Datapath... 5 9.3 Timing Issues... 7 9.4 A More Complex General Datapath... 9 9.5 VHDL for

More information

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design Two HDLs used today Introduction to Structured VLSI Design VHDL I VHDL and Verilog Syntax and ``appearance'' of the two languages are very different Capabilities and scopes are quite similar Both are industrial

More information

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language VHDL Introduction to Structured VLSI Design VHDL I Very High Speed Integrated Circuit (VHSIC) Hardware Description Language Joachim Rodrigues A Technology Independent, Standard Hardware description Language

More information

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated. 8-1 Name Binary code IDLE 000 Register operation or output R 0 RUN Condition (a) State box (b) Example of state box (c) Decision box IDLE R 0 From decision box START Register operation or output PC 0 (d)

More information

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems EE 3610: Digital Systems 1 Lecture 3: Modeling in VHDL VHDL: Overview 2 VHDL VHSIC Hardware Description Language VHSIC=Very High Speed Integrated Circuit Programming language for modelling of hardware

More information

Basic Language Concepts

Basic Language Concepts Basic Language Concepts Sudhakar Yalamanchili, Georgia Institute of Technology ECE 4170 (1) Describing Design Entities a sum b carry Primary programming abstraction is a design entity Register, logic block,

More information

VHDL: RTL Synthesis Basics. 1 of 59

VHDL: RTL Synthesis Basics. 1 of 59 VHDL: RTL Synthesis Basics 1 of 59 Goals To learn the basics of RTL synthesis. To be able to synthesize a digital system, given its VHDL model. To be able to relate VHDL code to its synthesized output.

More information

IT T35 Digital system desigm y - ii /s - iii

IT T35 Digital system desigm y - ii /s - iii UNIT - V Introduction to Verilog Hardware Description Language Introduction HDL for combinational circuits Sequential circuits Registers and counters HDL description for binary multiplier. 5.1 INTRODUCTION

More information

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language) Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits Hardware Description Language) 1 Standard ICs PLD: Programmable Logic Device CPLD: Complex PLD FPGA: Field Programmable

More information

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 8, 2006 Midterm Average: 70 Lecture 16: Midterm Solutions Homework 6: Calculator Handshaking HW 6: Due Wednesday, November

More information

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book BUILDING BLOCKS OF A BASIC MICROPROCESSOR Part PowerPoint Format of Lecture 3 of Book Decoder Tri-state device Full adder, full subtractor Arithmetic Logic Unit (ALU) Memories Example showing how to write

More information

CS/EE Homework 7 Solutions

CS/EE Homework 7 Solutions CS/EE 260 - Homework 7 Solutions 4/2/2001 1. (20 points) A 4 bit twisted ring counter is a sequential circuit which produces the following sequence of output values: 0000, 1000, 1100, 1110, 1111, 0111,

More information

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below: Experiment-3: Write VHDL programs for the following circuits, check the wave forms and the hardware generated a. multiplexer b. De-Multiplexer Objective: i. To learn the VHDL coding for Multiplexer and

More information

Very High Speed Integrated Circuit Har dware Description Language

Very High Speed Integrated Circuit Har dware Description Language Very High Speed Integrated Circuit Har dware Description Language Industry standard language to describe hardware Originated from work in 70 s & 80 s by the U.S. Departm ent of Defence Root : ADA Language

More information

Contents. Appendix D VHDL Summary Page 1 of 23

Contents. Appendix D VHDL Summary Page 1 of 23 Appendix D VHDL Summary Page 1 of 23 Contents Appendix D VHDL Summary...2 D.1 Basic Language Elements...2 D.1.1 Comments...2 D.1.2 Identifiers...2 D.1.3 Data Objects...2 D.1.4 Data Types...2 D.1.5 Data

More information

Review of Digital Design with VHDL

Review of Digital Design with VHDL Review of Digital Design with VHDL Digital World Digital world is a world of 0 and 1 Each binary digit is called a bit Eight consecutive bits are called a byte Hexadecimal (base 16) representation for

More information

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles ECE 448 Lecture 4 Sequential-Circuit Building Blocks Mixing Description Styles George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 4, Regular Sequential Circuit Recommended

More information

CHAPTER NINE - MSI Logic Circuits

CHAPTER NINE - MSI Logic Circuits CHAPTER NINE - MSI Logic Circuits 9. (a) All of the outputs are HIGH. (b) O =, O- O7 = (c) O - O6 =, O7 =. (d) Same as (a). 9.2 Inputs = 6: Outputs = 64 9.3 (a) [ O6] -> A2=, A=, A=, E3=, E2 =, E= (b)

More information

Introduction to VHDL #3

Introduction to VHDL #3 ECE 322 Digital Design with VHDL Introduction to VHDL #3 Lecture 7 & 8 VHDL Modeling Styles VHDL Modeling Styles Dataflow Concurrent statements Structural Components and interconnects Behavioral (sequential)

More information

CSC / EE Digital Systems Design. Summer Sample Project Proposal 01

CSC / EE Digital Systems Design. Summer Sample Project Proposal 01 THE CATHOLIC UNIVERSITY OF AMERICA SCHOOL OF ENGINEERING DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE CSC / EE 519-01 Digital Systems Design Summer 2013 Sample Project Proposal 01 Thursday

More information

Lattice VHDL Training

Lattice VHDL Training Lattice Part I February 2000 1 VHDL Basic Modeling Structure February 2000 2 VHDL Design Description VHDL language describes a digital system as a set of modular blocks. Each modular block is described

More information

ECE 545 Lecture 4. Simple Testbenches. George Mason University

ECE 545 Lecture 4. Simple Testbenches. George Mason University ECE 545 Lecture 4 Simple Testbenches George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 2.2.4, Testbenches 2 Testbenches ECE 448 FPGA and ASIC Design with VHDL 3 Testbench

More information

Chapter 6 Combinational-Circuit Building Blocks

Chapter 6 Combinational-Circuit Building Blocks Chapter 6 Combinational-Circuit Building Blocks Commonly used combinational building blocks in design of large circuits: Multiplexers Decoders Encoders Comparators Arithmetic circuits Multiplexers A multiplexer

More information

Getting Started with VHDL

Getting Started with VHDL Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component Entities can be primitive objects or complex objects Architectures are associated

More information

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library : UNIT I Introduction to VHDL VHDL stands for very high-speed integrated circuit hardware description language. Which is one of the programming languages used to model a digital system by dataflow, behavioral

More information

Lecture 12 VHDL Synthesis

Lecture 12 VHDL Synthesis CPE 487: Digital System Design Spring 2018 Lecture 12 VHDL Synthesis Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1 What is Synthesis?

More information

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN Control Unit: Binary Multiplier Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN Example: Binary Multiplier Two versions Hardwired control Microprogrammed

More information

EECE 353: Digital Systems Design Lecture 10: Datapath Circuits

EECE 353: Digital Systems Design Lecture 10: Datapath Circuits EECE 353: Digital Systems Design Lecture 10: Datapath Circuits Cristian Grecu grecuc@ece.ubc.ca Course web site: http://courses.ece.ubc.ca/353 Introduction to lecture 10 Large digital systems are more

More information

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1 Lecture 1: VHDL Quick Start Digital Systems Design Fall 10, Dec 17 Lecture 1 1 Objective Quick introduction to VHDL basic language concepts basic design methodology Use The Student s Guide to VHDL or The

More information

EEL 4712 Digital Design Test 2 Spring Semester 2008

EEL 4712 Digital Design Test 2 Spring Semester 2008 IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer gets the most points. COVER SHEET: Problem: Points:

More information

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014 CSE 260 Introduction to Digital Logic and Computer Design Jonathan Turner Exam 1 Your name 2/13/2014 1. (10 points) Draw a logic diagram that implements the expression A(B+C)(C +D)(B+D ) directly (do not

More information

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit VHDL VHDL Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit VHDL Alternative (Student Generated) Definition Very Hard Digital Logic language VHDL Design

More information

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes) Last (family) name: Answer Key First (given) name: Student I.D. #: Department of Electrical and Computer Engineering University of Wisconsin - Madison ECE 551 Digital System Design and Synthesis Midterm

More information

Microcomputers. Outline. Number Systems and Digital Logic Review

Microcomputers. Outline. Number Systems and Digital Logic Review Microcomputers Number Systems and Digital Logic Review Lecture 1-1 Outline Number systems and formats Common number systems Base Conversion Integer representation Signed integer representation Binary coded

More information

CprE 583 Reconfigurable Computing

CprE 583 Reconfigurable Computing Recap Moore FSM Example CprE / ComS 583 Reconfigurable Computing Moore FSM that recognizes sequence 10 0 1 0 1 S0 / 0 S1 / 0 1 S2 / 1 Prof. Joseph Zambreno Department of Electrical and Computer Engineering

More information

Pollard s Tutorial on Clocked Stuff in VHDL

Pollard s Tutorial on Clocked Stuff in VHDL Pollard s Tutorial on Clocked Stuff in VHDL Welcome to a biased view of how to do register type of stuff in VHDL. The object of this short note is to identify one way to easily handle registered logic

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3 DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 3 BEHAVIORAL DESCRIPTION Asynchronous processes (decoder, mux, encoder, etc): if-else, case, for-loop. BEHAVIORAL DESCRIPTION (OR SEQUENTIAL) In this design style,

More information

Chapter 2 Basic Logic Circuits and VHDL Description

Chapter 2 Basic Logic Circuits and VHDL Description Chapter 2 Basic Logic Circuits and VHDL Description We cannot solve our problems with the same thinking we used when we created them. ----- Albert Einstein Like a C or C++ programmer don t apply the logic.

More information

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University ECE 545 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 5.1, VHDL Process Chapter 8, Sequential

More information

CprE 583 Reconfigurable Computing

CprE 583 Reconfigurable Computing Recap 4:1 Multiplexer CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #18 VHDL for Synthesis I LIBRARY ieee

More information

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden Synthesis from VHDL Krzysztof Kuchcinski Krzysztof.Kuchcinski@cs.lth.se Department of Computer Science Lund Institute of Technology Sweden March 23, 2006 Kris Kuchcinski (LTH) Synthesis from VHDL March

More information

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\ CSCI 250 - Lab 3 VHDL Syntax Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\ Objectives 1. Learn VHDL Valid Names 2. Learn the presentation of Assignment and Comments 3. Learn Modes, Types, Array,

More information

EEL 4712 Digital Design Test 1 Spring Semester 2007

EEL 4712 Digital Design Test 1 Spring Semester 2007 IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. COVER SHEET: Problem: Points: 1 (15 pts) 2 (20 pts) Total 3 (15 pts) 4 (18 pts)

More information

Test Benches - Module 8

Test Benches - Module 8 Test Benches Module 8 Jim Duckworth, WPI 1 Overview We have concentrated on VHDL for synthesis Can also use VHDL as a test language Very important to conduct comprehensive verification on your design To

More information

ECE 545 Lecture 12. FPGA Resources. George Mason University

ECE 545 Lecture 12. FPGA Resources. George Mason University ECE 545 Lecture 2 FPGA Resources George Mason University Recommended reading 7 Series FPGAs Configurable Logic Block: User Guide Overview Functional Details 2 What is an FPGA? Configurable Logic Blocks

More information

FPGA.

FPGA. CMOS TTL Verilog VHDL mshora@yahoo.com 7400. NAND CMOS TTL 1 0 source sink datasheet bounce bounce debunce RS Latch debounce Typical Characteristics NO NC Semiconductor Material Wavelength Colour V F @

More information

SRI SUKHMANI INSTITUTE OF ENGINEERING AND TECHNOLOGY, DERA BASSI (MOHALI)

SRI SUKHMANI INSTITUTE OF ENGINEERING AND TECHNOLOGY, DERA BASSI (MOHALI) SRI SUKHMANI INSTITUTE OF ENGINEERING AND TECHNOLOGY, DERA BASSI (MOHALI) VLSI LAB MANUAL ECE DEPARTMENT Introduction to VHDL It is a hardware description language that can be used to model a digital system

More information

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3 DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 3 BEHAVIORAL DESCRIPTION Asynchronous processes (decoder, mux, encoder, etc): if-else, case, for-loop. Arithmetic expressions inside asynchronous processes.

More information

EITF35 - Introduction to the Structured VLSI Design (Fall 2016) Interfacing Keyboard with FPGA Board. (FPGA Interfacing) Teacher: Dr.

EITF35 - Introduction to the Structured VLSI Design (Fall 2016) Interfacing Keyboard with FPGA Board. (FPGA Interfacing) Teacher: Dr. EITF35 - Introduction to the Structured VLSI Design (Fall 2016) Interfacing Keyboard with FPGA Board (FPGA Interfacing) Teacher: Dr. Liang Liu v.1.0.0 1 Abstract This document describes the basic behavior

More information

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University Digital Circuit Design and Language Datapath Design Chang, Ik Joon Kyunghee University Typical Synchronous Design + Control Section : Finite State Machine + Data Section: Adder, Multiplier, Shift Register

More information

EL 310 Hardware Description Languages Midterm

EL 310 Hardware Description Languages Midterm EL 3 Hardware Description Languages Midterm 2 3 4 5 Total Name: ID : Notes: ) Please answer the questions in the provided space after each question. 2) Duration is minutes 3) Closed books and closed notes.

More information

INTRODUCTION TO VHDL ADVANCED COMPUTER ARCHITECTURES. Slides by: Pedro Tomás. Additional reading: - ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC)

INTRODUCTION TO VHDL ADVANCED COMPUTER ARCHITECTURES. Slides by: Pedro Tomás. Additional reading: - ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC) INTRODUCTION TO VHDL Slides by: Pedro Tomás Additional reading: - ADVANCED COMPUTER ARCHITECTURES ARQUITECTURAS AVANÇADAS DE COMPUTADORES (AAC) Outline 2 Hardware Description Languages (HDL) VHDL Very

More information

Digital Systems Design

Digital Systems Design Digital Systems Design Review of Combinatorial Circuit Building Blocks: VHDL for Combinational Circuits Dr. D. J. Jackson Lecture 2-1 Introduction to VHDL Designer writes a logic circuit description in

More information

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Cengage Learning Design Flow 418_02 2 VHDL Modules 418_02 3 VHDL Libraries library IEEE; use IEEE.std_logic_1164.all; std_logic Single-bit

More information

VHDL Examples Mohamed Zaky

VHDL Examples Mohamed Zaky VHDL Examples By Mohamed Zaky (mz_rasmy@yahoo.co.uk) 1 Half Adder The Half Adder simply adds 2 input bits, to produce a sum & carry output. Here we want to add A + B to produce Sum (S) and carry (C). A

More information

Homework deadline extended to next friday

Homework deadline extended to next friday Norm Midterm Grading Finished Stats on course homepage Pickup after this lab lec. Regrade requests within 1wk of posted solution Homework deadline extended to next friday Description Design Conception

More information

COVER SHEET: Total: Regrade Info: 2 (6 points) 3 (8 points) 4 (10 points) 8 (12 points) 6 (6 points) 7 (6 points) 9 (30 points) 10 (4 points)

COVER SHEET: Total: Regrade Info: 2 (6 points) 3 (8 points) 4 (10 points) 8 (12 points) 6 (6 points) 7 (6 points) 9 (30 points) 10 (4 points) EEL 4712 Midterm 2 Spring 2010 VERSION 1 Name: UFID: Sign your name here if you would like for your test to be returned in class: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read

More information

VHDL for Complex Designs

VHDL for Complex Designs ELEC 379 : DESIGN OF DIGITAL AND MICROCOMPUTER SYSTEMS 1998/99 WINTER SESSION, TERM 2 VHDL for Complex Designs This lecture covers VHDL features that are useful when designing complex logic circuits. After

More information

ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices

ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices School of Engineering, University of Guelph Winter 2017 1 Objectives: The purpose of this lab is : Learn basic bus design techniques.

More information

HDL. Hardware Description Languages extensively used for:

HDL. Hardware Description Languages extensively used for: HDL Hardware Description Languages extensively used for: Describing (digital) hardware (formal documentation) Simulating it Verifying it Synthesizing it (first step of modern design flow) 2 main options:

More information

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points) EEL 4712 Midterm 2 Spring 2011 VERSION 1 Name: UFID: Sign your name here if you would like for your test to be returned in class: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read

More information

Summary of FPGA & VHDL

Summary of FPGA & VHDL FYS4220/9220 Summary of FPGA & VHDL Lecture #6 Jan Kenneth Bekkeng, University of Oslo - Department of Physics 16.11.2011 Curriculum (VHDL & FPGA part) Curriculum (Syllabus) defined by: Lectures Lecture6:

More information

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 3, RT-level

More information

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University ECE 545 Lecture 8 Data Flow Description of Combinational-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 7, Combinational Circuit Design:

More information

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 3, RT-level

More information

EITF35 - Introduction to Structured VLSI Design (Fall ) 7. Assignment 3 - Arithmetic Logic Unit (ALU)

EITF35 - Introduction to Structured VLSI Design (Fall ) 7. Assignment 3 - Arithmetic Logic Unit (ALU) EITF35 - Introduction to Structured VLSI Design (Fall 2018 2016 2015) 7 Assignment 3 - Arithmetic Logic Unit (ALU) v.1.1.0 Introduction In this lab assignment, a simple arithmetic logic unit (ALU) will

More information

EITF35: Introduction to Structured VLSI Design

EITF35: Introduction to Structured VLSI Design EITF35: Introduction to Structured VLSI Design Part 1.2.2: VHDL-1 Liang Liu liang.liu@eit.lth.se 1 Outline VHDL Background Basic VHDL Component An example FSM Design with VHDL Simulation & TestBench 2

More information

Computer-Aided Digital System Design VHDL

Computer-Aided Digital System Design VHDL بس م اهلل الر حم ن الر حی م Iran University of Science and Technology Department of Computer Engineering Computer-Aided Digital System Design VHDL Ramin Rajaei ramin_rajaei@ee.sharif.edu Modeling Styles

More information

Introduction to VHDL #1

Introduction to VHDL #1 ECE 3220 Digital Design with VHDL Introduction to VHDL #1 Lecture 3 Introduction to VHDL The two Hardware Description Languages that are most often used in industry are: n VHDL n Verilog you will learn

More information

EE6301 DIGITAL LOGIC CIRCUITS UNIT V VHDL PART A

EE6301 DIGITAL LOGIC CIRCUITS UNIT V VHDL PART A EE6301 DIGITAL LOGIC CIRCUITS UNIT V VHDL PART A 1. Write a VHDL code for 2 x 1 MUX. [N/D 14], [ M/J 16], [A/M 17] library ieee; use ieee.std_logic_1164.all; entity mux2_1 is port (a,b,sel:instd_logic;

More information

14:332:331. Computer Architecture and Assembly Language Fall Week 5

14:332:331. Computer Architecture and Assembly Language Fall Week 5 14:3:331 Computer Architecture and Assembly Language Fall 2003 Week 5 [Adapted from Dave Patterson s UCB CS152 slides and Mary Jane Irwin s PSU CSE331 slides] 331 W05.1 Spring 2005 Head s Up This week

More information

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE One and a half hours Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE Fundamentals of Computer Engineering Date: Thursday 21st January 2016 Time: 14:00-15:30 Answer BOTH Questions

More information

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14 COE 405, Term 062 Design & Modeling of Digital Systems HW# 1 Solution Due date: Wednesday, March. 14 Q.1. Consider the 4-bit carry-look-ahead adder (CLA) block shown below: A 3 -A 0 B 3 -B 0 C 3 4-bit

More information

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements EECE-4740/5740 Advanced VHDL and FPGA Design Lecture 3 Concurrent and sequential statements Cristinel Ababei Marquette University Department of Electrical and Computer Engineering Overview Components hierarchy

More information

In our case Dr. Johnson is setting the best practices

In our case Dr. Johnson is setting the best practices VHDL Best Practices Best Practices??? Best practices are often defined by company, toolset or device In our case Dr. Johnson is setting the best practices These rules are for Class/Lab purposes. Industry

More information

Esempio FSM Description : library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity esempiofsm is port ( clk: in STD_LOGIC; p: in STD_LOGIC; reset:

More information

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic CPE 626 Lecture 6: VHDL Synthesis Aleksandar Milenkovic http://www.ece.uah.edu/~milenka http://www.ece.uah.edu/~milenka/cpe626-04f/ milenka@ece.uah.edu Assistant Professor Electrical and Computer Engineering

More information

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used.

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used. Filename= ch5.doc 5. 0 VHDL OPERATORS There are seven groups of predefined VHDL operators: 1. Binary logical operators: and or nand nor xor xnor 2. Relational operators: = /= < >= 3. Shifts operators:

More information

Problem Set 10 Solutions

Problem Set 10 Solutions CSE 260 Digital Computers: Organization and Logical Design Problem Set 10 Solutions Jon Turner thru 6.20 1. The diagram below shows a memory array containing 32 words of 2 bits each. Label each memory

More information

Design Examples. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

Design Examples. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning Design Examples ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Cengage Learning BCD to 7-Segment Display 418_04 2 BCD to 7-Segment Display entity BCD_Seven is port(bcd: in std_logic_vector(3

More information

3 Designing Digital Systems with Algorithmic State Machine Charts

3 Designing Digital Systems with Algorithmic State Machine Charts 3 Designing with Algorithmic State Machine Charts An ASM chart is a method of describing the sequential operations of a digital system which has to implement an algorithm. An algorithm is a well defined

More information