CHAPTER Pearson Education, Inc. S_n. R_n. Q_n. 0 ps 20 ns 40 ns 60 ns 80 ns. C S R Q Q_n. 0 ps 50 ns 100 ns 150 ns 200 ns

Size: px
Start display at page:

Download "CHAPTER Pearson Education, Inc. S_n. R_n. Q_n. 0 ps 20 ns 40 ns 60 ns 80 ns. C S R Q Q_n. 0 ps 50 ns 100 ns 150 ns 200 ns"

Transcription

1 HAPTER 5 28 Pearson Education, Inc. 5-. S_n R_n Q Q_n 5-2. S R Q Q_n ps 2 ns 4 ns 6 ns 8 ns ps 5 ns ns 5 ns 2 ns 5-3. Q Q_n ps 5 ns ns 5 ns

2 5-5. Unknown 5-6. A Y A B Z B Present state Inputs Next state Output A B Y A B Z S - S - S2 - S3 - / / S /,/ S / S3 / / / S2 / / ( = unspecified) Y/Z ( = unspecified) 64

3 5-7.* Present state Input Next state A B A B A = (B + B) x + (B + B) x A = B + A = A A = B = = 5-8. Present state Inputs Next state Output Q Y Q S /, / /, / /, / /, / Format: Y/S 5-9. Present State Input Output Next State 5-. / / / x/, / / / / / 3 2 x/, / Format: Y/Z /, / / 65

4 5-.* S A = B R A = B S B = A R B = A Present state Input Next state Output / / A B A B Y / / / 2 3 / Format: /Y / / 5-2. a) A =, B =, Reset =, Asynchronous Reset A = A + B B = A A =, B =, Reset = S R A A =, B =, Reset = Reset S B Asynchronous Reset All the others gates remains as in figure 5-5. R b) A =, B =, Signal Reset =, Synchronous Reset. A A Reset lock B B Y 66

5 5-3.* Present state Input Next state A B A B A A = B + A B B A B = A + B A A B B 5-4. a) State Table Present state Inputs Next state Output Q Q 2 2 Q t+ Q 2 t+ Z Encoding: State ode(q Q 2 ) A B 67

6 Q Q2 Q Q Q2 Q2 Q Q Next State Q(t+) Present state For Input Output Q(t) = = Z A B B A F F E E F E F Encoding: State ode(q Q 2 Q 3 ) A B E F Unused states:,. The state assignment could be different. E.g. statesa,borcould be and states, E or F could be. 68

7 Q Q 2 Q Encoding: State ode(q Q 2 Q 3 ) A B E F Next State Q(t+) Present state For Input Output Q(t) = = Z A E B E E F A E B F E 69

8 Next State Q(t+) Output Present state For Input Q(t) = = M M N N N O O M M Y = YZ Z = Z + YZ Gate input cost of the original circuit: = 63 Gate input cost of the new circuit: = 37 States A,, F are equivalent and merged to get state M. States B and E are equivalent and merged to get state N. State becomes state O. Encoding: Z is a state variable and an output, and Y is a state variable. State ode(yz) M N O 5-7. Present state Inputs Next state Output ABE a b c d ABE U x x x x x x x x x x x x x x x x x x x x x x x x x x x x A = AA + BB + + B = A A = BB = E = E + U = E Signal L is applied to the asynchronous set/reset inputs on the flip-flops to implement locking. A B E U 7

9 5-8.* / x/x Format: Y/Z (x = unspecified) x/x / / / Present state Inputs Next state Output Q(t) Y Q(t+) Z 5-9. E= / / 2/ 3/ 4/ 5/ 6/ 7/ E= Present state Next State For Input Output 2 E= E= Z The state assignment could be different. E. g., state 7 could be with state. This would permit use of R inputs on the flip-flops for RESET. RESET E S S Z S 2 LK 7

10 5-2. E= / / 2/ 3/ 4/ 5/ 6/ 7/ Present state Next State For Input E= Output 2 E= E= Z Assumes for E =, the output remains at. RESET E S S Z S LK =x/ Z=,S= 5 =/Z=,S= =/ Z=, S= =/ Z=,S= =/Z=,S= =/Z=,S= =/ Z=,S= =/ Z=,S= 4 3 =/Z=,S= =/ Z=,S= 2 =/ Z=,S= Present state Input Next state Output A B A B Z S 72

11 Z S LK = / Z= = / Z= = / Z= = / Z= Present state Input Next state Output A A Z LK R RESET Z = / Z= = / Z= = / Z= Present state Input Next state Output = / Z= A A Z Z LK R RESET 73

12 74 Problem Solutions hapter Reset / x/ xx/ / x/ / x/ / x/ / Format: RA/E (x = unspecified) / / / Present state Inputs Next state Output B R A B E Present state Inputs Next state Output B R A B E x/ / / x/ x/ Present state Input Next state Output A Y A Z Format: Y/Z (x = unspecified)

13 5-26.* To use a one-hot assignment, the two flip-flops A and B need to be replaced with four flip-flops Y4, Y3, Y2. Y. Problem Solutions hapter 5 Present State Input Next State Output A B Y4 Y3 Y2 Y A B" Y4 Y3 Y2 Y Z No Reset State Specified. = Y = Y + Y4 2 = Y2 = Y + Y2 3 = Y3 = Y2 + Y3 4 = Y4 = Y3 + Y4 Y Y2 Y3 Y4 Y lock 5-27.* a) S R Q Q No hange Reset Set Set b) Format: SR,,,, 75

14 c) Present state Input Next state Q S R Q(t+) A B x x x x x A = S B = SR S R A S B R lock Q Present State AB Next State AB a) A = B = A = B b) lear A = Reset lear B = Reset lear = Reset c, d, e, f) The circuit is suitable for child s toy, but not for life critical applications. In the case of the child s toy, it is the cheapest implementation. If an error occurs the child just needs to reset it. In life critical applications, the immediate detection of errors is critical. The circuit above enters invalid states for some errors. For a life critical application, additional circuitry is needed for immediate detection of the error (Error = AB + AB). This circuit using the design in a), does return from the invalid states to a valid state automatically after one or two clock periods. Specification Verification Present state Input Next state Next state Q S R Q(t+) A B A B Q(t+) x x x x x 76

15 5-3. lock Reset Y A B ps 2 ns 4 ns 6 ns 8 ns 5-3.* RESET 7 x/, / / / 2 / / / / 3 2 x/, / Format: Y/Z 5 / 4 /, / / 9 Reset,,,,,, x, x,,,,,,,,. Y A Z lock B lock Reset Y A B ps 2 ns 4 ns 6 ns 8 ns 77

16 5-33.* lock J K Y Q ps 5 ns ns 5 ns This simulation was performed without initializing the state of the latches of the flip-flop beforehand. Each gate in the flip-flop implementation has a delay of ns. The interaction of these delays with the input change times produced a narrow pulse in Y at about 55 ns. In this case, the pulse is not harmful since it dies out well before the positive clock edge occurs. Nevertheless, a thorough examination of such a pulse to be sure that it does not represent a design error or important timing problem is critical Function table for the LH flip-flop. LK LOA ATA OUTPUT L Q(t+) S R No change No change S L R LL Flipflop in a Master-Slave ircuit. S R Q Q Y State table: State State Transition Next State Non-zero ode ondition State ode Outputs A A B B / Z Y A Y Y / Z A Z Y + Y Y + Y Y2 78

17 5-36. Problem Solutions hapter 5 onstraint checks on the transition conditions (T): Init: There is one pair of Ts to check: (ST ART +STOP ) START S TO P = Fill_: There are three pairs of Ts to check: L S TOP STOP =, L S TOP L S TOP =, STOP L S TOP = Fill_2: There are six pairs of Ts to check: L2 N I S TOP STOP =, L2 N I S TOP L 2 S TOP =, L2 N I S TOP L2 NI S TOP =, STOP L 2 S TOP =, STOP L2 NI S TOP =, L 2 S TOP L2 NI S TOP = Fill_3: There are three pairs of Ts to check: L 3 S TOP STOP =, Mix: There are three pairs of Ts to check: L 3 S TOP L3 S TOP =, STOP L3 S TOP = T Z S TOP STOP =, T Z S TOP TZ S TOP =, STOP TZ S TOP = Empty: There is one pair of Ts to check: L S TOP (L+STOP) = onstraint 2 checks on the transition conditions (T): Init: S TART +STOP +START S TOP = Fill_: L S TOP +STOP +L S TOP = Fill_2: L2 N I S TOP +STOP + L 2 S TOP +L2 NI S TOP = Fill_3: L 3 S TOP +STOP +L3 S TOP = Mix: T Z S TOP +STOP + TZ S TOP = Empty: L S TOP +L+STOP = 5-37.* ( ) 79

18 5-38. State Transition Next State Non-zero State ode ondition State ode Outputs Init N 5 Q ispense N Q Init oin_return R Init 5 N 5 Q ispense R oin_return R N Q 5 N 5 2 Q ispense R oin_return R N Q 5 N 2 +Q ispense R oin_return R N Q 5 2 N + + Q ispense R oin_return ispense R N Q 2 Init J flip-flop inputs: Init (t + ) = Init N Q + oin_return + ispense oin_return (t + ) = 5 R+ R+5 R+2 R 5 (t + ) = Init N+5 R N Q (t + ) = Init +5 N+ R N Q 5 (t + ) = 5 + N+5 R N Q 2 (t + ) = +5 N+2 R N Q ispense (t + ) = Q N (a) R Reset Outputs: R = oin_return J = ispense Noh Q Q Q Q Q Q Init 25c 5c 75c c 25c isp_orange isp_root_beer No_hange R R R L O R R R Q R LT2Q isp_ola isp_lemon 5c L O R LE 2c Return_2_Quarters 8

19 (b) Some possible changes to the specification follow.. Provide appropriate change and dispense soda for the cases in which 75 cents and 25 cents followed by a dollar have been deposited. Provide a coin return button for the event that the user is out of quarters and dollars before the 5c state is reached. 3. hange the No hange warning to cover all added cases in. 5-4.* library IEEE; use IEEE.std_logic_64.all; entity mux_4to is port ( S: in ST_LOGI_VETOR ( downto ); : in ST_LOGI_VETOR (3 downto ); Y: out ST_LOGI ); mux_4to; -- (continued in the next column) architecture mux_4to_arch of mux_4to is process (S, ) case S is when "" => Y <= (); when "" => Y <= (); when "" => Y <= (2); when "" => Y <= (3); when others => null; process; mux_4to_arch; 5-4. library IEEE; use IEEE.std_logic_64.all; entity mux_4to is port ( S: in ST_LOGI_VETOR ( downto ); : in ST_LOGI_VETOR (3 downto ); Y: out ST_LOGI ); mux_4to; -- (continued in the next column) architecture mux_4to_arch of mux_4to is process (S, ) if S = "" then Y <= (); elsif S = "" then Y <= (); elsif S = "" then Y <= (2); elsif S = "" then Y <= (3); null; process; mux_4to_arch; 8

20 library IEEE; use IEEE.std_logic_64.all; entity serial_b_ex3 is port (clk, reset, : in ST_LOGI; Z : out ST_LOGI); serial_b_ex3; architecture process_3 of serial_b_ex3 is type state_type is (Init, B, B, B2, B2, B2, B3, B3); signal state, next_state: state_type; -- Process - state register state_register: process (clk, reset) if (reset = '') then state <= Init; if (LK'event and LK='') then state <= next_state; process; -- (continued in the next column) -- Process 2 - next state function next_state_func: process (, state) case state is when Init => if ( = '') then next_state <= B; next_state <= B; when B => if ( = '') then next_state <= B2; next_state <= B2; when B => next_state <= B2; when B2 => next_state <= B3; when B2 => if ( = '') then next_state <= B3; next_state <= B3; when B2 => if ( = '') then next_state <= B3; next_state <= B3; when B3 => next_state <= Init; when B3 => next_state <= Init; process; -- Process 3 -output function output_func: process (, state) case state is when Init => if ( = '') then Z <= ''; Z <= ''; when B => -- (continued in the next column) if ( = '') then Z <= ''; Z<= ''; when B => Z <= ; when B2 => Z <= ; when B2 => if ( = '') then Z <= ''; Z <= ''; when B2 => if ( = '') then Z <= ''; Z <= ''; when B3 => Z <= ; when B3 => Z <= ''; process; process_3; 82

21 clk reset x z state init b b2 b3x init b b2 b3x init b b2 b3x init clk reset x z state init b b2 b3 init b b2x b3x init b b2x b3 init library IEEE; use IEEE.std_logic_64.all; entity prob_5_43 is port (clk, reset : in ST_LOGI; : in ST_LOGI_VETOR(2 downto ) ; Z : out ST_LOGI); prob_5_43; architecture process_3 of prob_5_43 is type state_type is (A, B,, ); signal next_state, state : state_type; -- ontinued in next column -- Process - state register state_register: process (clk, reset) if (reset = '') then state <= A; elsif (clk'event and clk = '') then state <= next_state; process; -- Process 2 - next state function next_state_func: process (, state) -- ontinued on next page 83

22 case state is when A => case is when "" => next_state <= A; when "" => next_state <= B; when "" => next_state <= B; when "" => next_state <= A; when others => next_state <= A; when B => case is when "" => next_state <= A; when "" => next_state <= A; when "" => next_state <= ; when "" => next_state <= ; when others => next_state <= A; when => case is when "" => next_state <= A; when "" => next_state <= A; when "" => next_state <= ; when "" => next_state <= ; when others => next_state <= A; when => case is when "" => next_state <= ; when "" => next_state <= B; when "" => next_state <= B; when "" => next_state <= ; when others => next_state <= A; process; -- ontinued in next column -- Process 3 -output function output_func: process (, state) case state is when A => case is when "" => Z <= ''; when "" => Z <=''; when "" => Z <= ''; when "" => Z <= ''; when others => Z <= ''; when B => case is when "" => Z <= ''; when "" => Z <=''; when "" => Z <= ''; when "" => Z <= ''; when others => Z <= ''; when => case is when "" => Z <= ''; when "" => Z <=''; when "" => Z <= ''; when "" => Z <= ''; when others => Z <= ''; when => case is when "" => Z <= ''; when "" => Z <=''; when "" => Z <= ''; when "" => Z <= ''; when others => Z <= ''; process; process_3; 84

23 * library IEEE; use IEEE.std_logic_64.all; entity prob_5_44 is port (clk, reset, : in ST_LOGI; Z : out ST_LOGI); prob_5_44; architecture process_3 of prob_5_44 is type state_type is (A, B,,, E, F); signal state, next_state: state_type; -- Process - state register state_register: process (clk, reset) if (reset = '') then state <= A; if (LK'event and LK='') then state <= next_state; process; -- Process 2 - next state function next_state_func: process (, state) case state is when A => if = '' then next_state <= B; next_state <= ; when B => if = '' then next_state <= ; next_state <= ; when => if = '' then next_state <= A; -- ontinued in next column library IEEE; use IEEE.std_logic_64.all; entity jkff is port ( J,K,LK: in ST_LOGI; Q: out ST_LOGI ); jkff; architecture jkff_arch of jkff is signal q_out: std_logic; state_register: process (LK) if LK'event and LK='' then --LK falling edge -- (continued in the next column) next_state <= F; when => if = '' then next_state <= F; next_state <= ; when E => if = '' then next_state <= ; next_state <= E; when F => if = '' then next_state <= E; next_state <= F; process; -- Process 3 -output function output_func: process (, state) case state is when A => Z <= ''; when B => Z <= ''; when => Z <= ''; when => Z <= ''; when E => Z <= ''; when F => Z <= ''; process; process_3; case J is when '' => if K = '' then q_out <= ''; when '' => if K = '' then q_out <= ''; q_out <= not q_out; when others => null; process; Q <= q_out; jkff_arch; 85

24 86

25 5-46. (Errata: Replace "5-" with "5-") library IEEE; use IEEE.std_logic_64.all; entity prob_5_46 is port (clk, reset, NI, Start, Stop, L, L, L2, L3, TZ : in ST_LOGI; M, PST, TM, V, V2, V3, VE : out ST_LOGI); prob_5_46; architecture process_3 of prob_5_46 is type state_type is (Init, Fill_, Fill_2, Fill_3, Mix, Empty); signal state, next_state: state_type; -- Process - state register state_register: process (clk, reset) if (reset = '') then state <= Init; if (LK'event and LK='') then state <= next_state; process; -- Process 2 - next state function next_state_func: process (NI, Start, Stop, L, L, L2, L3, TZ, state) if Stop = '' then next_state <= Init; case state is when Init => if Start = '' then next_state <= Fill_; next_state <= Init; when Fill_ => if L = '' then next_state <= Fill_2; next_state <= Fill_; when Fill_2 => if L2 = '' then if NI = ''then next_state <= Fill_3; next_state <= Mix; next_state <= Fill_2; -- ontinued in next column process; when Fill_3 => if L3 = '' then next_state <= Mix; next_state <= Fill_3; when Mix => if TZ = '' then next_state <= Empty; next_state <= Mix; when Empty => if L = '' then next_state <= Init; next_state <= Empty; -- Process 3 - output function output_func: process (L2, L3, NI, TZ, Stop, state) M <= ''; PST <=''; TM <=''; V <=''; V2 <=''; V3 <=''; VE <=''; case state is when Init => when Fill_ => V <= ''; when Fill_2 => V2 <= ''; if ((L2 and not NI and not Stop) = '') then PST <= ''; when Fill_3 => V3 <= ''; if ((L3 and not Stop) = '') then PST <= ''; when Mix => M <= ''; if ((not TZ and not Stop) = '') then TM <= ''; when Empty => VE <= ''; process; process_3; 87

26 5-47. library IEEE; use IEEE.std_logic_64.all; entity prob_5_47 is port (clk, reset, R, N,, Q : in ST_LOGI; J, R : out ST_LOGI); prob_5_47; architecture process_3 of prob_5_47 is type state_type is (S, S5, S, S5, S2, S25, RT); signal state, next_state: state_type; -- Process - state register state_register: process (clk, reset) if (reset = '') then state <= S; if (LK'event and LK='') then state <= next_state; process; -- Process 2 - next state function next_state_func: process (R, N,, Q, state) case state is when S => if N = '' then next_state <= S5; elsif = '' then next_state <= S; elsif Q = '' then next_state <= S25; next_state <= S; when S5 => if R = '' then next_state <= RT; elsif N = '' then next_state <= S; elsif = '' then next_state <= S5; elsif Q = '' then next_state <= S25; next_state <= S5; when S5 => if R = '' then next_state <= RT; elsif N = '' then next_state <= S2; elsif = '' then next_state <= S25; elsif Q = '' then next_state <= S25; next_state <= S5; when S2 => if R = '' then next_state <= RT; elsif N = '' then next_state <= S25; elsif = '' then next_state <= S25; elsif Q = '' then next_state <= S25; next_state <= S2; when S25 => next_state <= S; when RT => next_state <= S; process; -- Process 3 - output function output_func: process (R, N,, Q, state) J <= ''; R <= ''; case state is when S25 => J <= ''; when RT => R <= ''; when others => null; process; process_3; when S => if R = '' then next_state <= RT; elsif N = '' then next_state <= S5; elsif = '' then next_state <= S2; elsif Q = '' then next_state <= S25; next_state <= S; -- ontinued in next column 88

27 * module problem_6_38 (S,, Y) ; input [:] S ; input [3:] ; output Y; reg Y ; // (continued in the next column) module problem_6_39 (S,, Y) ; input [:] S ; input [3:] ; output Y; reg Y ; // (continued in the next column) //Serial B to Excess 3 onverter module serial_b_ex3(clk, reset,, Z); input clk, reset, ; output Z; reg[2:] state, next_state; parameter Init = 3'b, B = 3'b, B=3'b, B2= 3'b, B2 = 3'b, B2 = 3'b, B3 = 3'b, B3 = 3'b; reg Z; // State Register always@(posedge clk or posedge reset) if (reset == ) state <= Init; state <= next_state; // Next StateFunction always@( or state) case (state) Init: if ( == ) next_state <= B; next_state <= B; B: if ( == ) next_state <= B2; next_state <= B2; B: next_state <= B2; B2: next_state <= B3; B2: if ( == ) next_state <= B3; next_state <= B3; // (continued in the next column) or ) case (S) 2'b : Y <= [] ; 2'b : Y <= [] ; 2'b : Y <= [2] ; 2'b : Y <= [3] ; case; module or ) if (S == 2'b) Y <= []; if (S == 2'b) Y <= []; if (S == 2'b) Y <= [2]; Y <= [3]; module B2: if ( ==) next_state <= B3; next_state <= B3; B3: next_state <= Init; B3: next_state <= Init; case // Output Function always@( or state) case (state) Init: if ( == ) Z <= ; Z <= ; B: if ( == ) Z <= ; Z <= ; B: Z <= ; B2: Z <= ; B2: if ( == ) Z <= ; Z <= ; B2: if ( == ) Z <= ; Z <= ; B3: Z <= ; B3: Z <= ; case module 89

28 State Assignment State ode State Name Init B B2 B B3 B3 B2 B2 clk reset Z state clk reset Z state // State iagram in Figure 5-4 using Verilog module prob_5_5 (clk, reset,, Z); input clk, reset; input[:2] ; output Z; reg[:] state, next_state; parameter A = 2'b, B = 2'b, = 2'b, = 2'b; reg Z; // State Register always@(posedge clk or posedge reset) if (reset == ) state <= A; state <= next_state; // Next StateFunction always@( or state) case (state) A: if ( == 2'b == 2'b) next_state <= B; next_state <= A; B: if ( == 2'b == 2'b) next_state <= ; next_state <= A; : if ( == 2'b == 2'b) // (continued in the next column) next_state <= A; next_state <= ; : if ( == 2'b == 2'b) next_state <= ; next_state <= B; case // Output Function always@( or state) case (state) A: if ( == 2'b == 2'b == 2'b) Z <= ; Z <= ; B: if ( == 2'b == 2'b) Z <= ; Z <= ; : if ( == 2'b == 2'b) Z <= ; Z <= ; : if ( == 2'b == 2'b == ) Z <= ; Z = ; case module 9

29 5-52. // State iagram in Figure 5-4 using Verilog module prob_5_52 (clk, reset,, Z); input clk, reset; input ; output Z; reg[2:] state, next_state; parameter A = 3'b, B = 3'b, = 3'b, = 3'b, E = 3'b, F = 3'b; reg Z; // State Register always@(posedge clk or posedge reset) if (reset == ) state <= A; state <= next_state; // Next StateFunction always@( or state) case (state) A: if ( == ) next_state <= ; next_state <= B; B: if ( == ) next_state <= ; next_state <= ; : if ( == ) (continued in the next column) 5-53.* module JK_FF (J, K, LK, Q) ; input J, K, LK ; output Q; reg Q; next_state <= F; next_state <= A; : if ( == ) next_state <= ; next_state <= F; E: if ( == ) next_state <= E; next_state <= ; F: if ( == ) next_state <= F; next_state <= E; case // Output Function always@( or state) case (state) A: Z <= ; B: Z <= ; : Z <= ; : Z <= ; E: Z <= ; F: Z <= ; case module LK) case (J) 'b: Q <= K? : Q; 'b: Q <= K? ~Q: ; case module 9

30 5-54. // State Machine for Batch Mixing System (Figure 5-29) module batch_mixing_system (clk, reset, START, STOP, L, L, L2, L3, NI, TZ, V, V2, V3, PST, M, TM, VE); input clk, reset, START, STOP, L, L, L2, L3, NI, TZ; output V, V2, V3, PST, M, TM, VE; reg V, V2, V3, PST, M, TM, VE; reg[2:] state, next_state; parameter Init = 3'b, Fill_ = 3'b, Fill_2 = 3'b, Fill_3 = 3'b, Mix = 3'b, Empty = 3'b; // State Register always@(posedge clk or posedge reset) // (continued in the next column) if (reset == ) state <= Init; state <= next_state; // Next StateFunction always@( START or STOP or L or L or L2 or L3 or TZ or state) case (state) Init: if (START == & STOP == ) next_state <= Fill_; next_state <= Init; // (continued on the next page) Fill_: if (STOP == ) next_state <= Init; if (L == ) next_state <= Fill_2; next_state <= Fill_; Fill_2: if (STOP == ) next_state <= Init; if (L2 == ) if (NI == ) next_state <= Fill_3; next_state <= Mix; next_state <= Fill_2; Fill_3: if (STOP == ) next_state <= Init; if (L3 == ) next_state <= Mix; next_state <= Fill_2; Mix: if (STOP == ) next_state <= Init; if (TZ == ) next_state <= Empty; next_state <= Mix; Empty: if (STOP == L == ) next_state <= Init; next_state <= Empty; // (continued in the next column) case // Output Function always@(l2 or NI or STOP or L3 or TZ or state) case (state) Fill_: V <= ; Fill_2: V2 <= ; if (L2 & ~ NI & ~STOP) PST <= ; PST <= ; Fill_3: V3 <= ; if (L3 & ~STOP) PST <= ; PST <= ; Mix: M <= ; if (~TZ & ~STOP) TM <= ; TM <= ; Empty: VE <= ; case module 92

31 5-55. // State Machine for Jawbreaker Ving Machine module jawbreaker_ving_machine (clk, reset, R, N,, Q, R, J); input clk, reset, R, N,, Q; output R, J; reg R, J; reg[6:] state, next_state; parameter Init = 7'b, S5c = 7'b, Sc = 7'b, S5c = 7'b, S2c = 7'b, ispense = 7'b, oin_return = 7'b; // State Register always@(posedge clk or posedge reset) if (reset == ) state <= Init; state <= next_state; // Next StateFunction always@(r or N or or Q or state) case (state) Init: if (N == ) next_state <= S5c; if ( == ) next_state <= Sc; if (Q == ) next_state <= ispense; next_state <= Init; // (continued in the next column) S5c: if (N == ) next_state <= Sc; if ( == ) next_state <= S5c; if (Q == ) next_state <= ispense; if (R == ) next_state <= oin_return; next_state <= S5c; Sc: if (N == ) next_state <= S5c; if ( == ) next_state <= S2c; if (Q == ) next_state <= ispense; if (R == ) next_state <= oin_return; next_state <= Sc; S5c: if (N == ) next_state <= S2c; if ( == ) next_state <= ispense; if (Q == ) next_state <= ispense; if (R == ) next_state <= oin_return; next_state <= S5c; S2c: if (N == ) next_state <= ispense; if ( == ) next_state <= ispense; if (Q == ) next_state <= ispense; if (R == ) next_state <= oin_return; next_state <= S2c; ispense: next_state <= Init; oin_return: next_state <= Init; case (continued in the next column) // Output Function always@(state) R <= ; J <= ; case (state) ispense: J <= ; oin_return: R <= ; case module ; 93

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits EE 459/5 HL Based igital esign with Programmable Logic Lecture 6 ombinational and sequential circuits Read before class: hapter 2 from textbook Overview ombinational circuits Multiplexer, decoders, encoders,

More information

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule EEU530 EE U530 igital Hardware Synthesis Lecture 11: Prof. Miriam Leeser mel@coe.neu.edu October 18, 2005 Sequential Logic in VHL Finite State Machines in VHL Project proposals due now HW 4 due Wednesday,

More information

EE 231 Fall EE 231 Homework 8 Due October 20, 2010

EE 231 Fall EE 231 Homework 8 Due October 20, 2010 EE 231 Homework 8 Due October 20, 20 1. Consider the circuit below. It has three inputs (x and clock), and one output (z). At reset, the circuit starts with the outputs of all flip-flops at 0. x z J Q

More information

Laboratory Exercise 3 Davide Rossi DEI University of Bologna AA

Laboratory Exercise 3 Davide Rossi DEI University of Bologna AA Laboratory Exercise 3 Davide Rossi DEI University of Bologna AA 2017-2018 Objectives Summary of finite state machines (Mealy, Moore) Description of FSMs in System Verilog Design of control blocks based

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

Mealy and Moore examples

Mealy and Moore examples CSE 37 Spring 26 Introduction to igital esign ecture 2: uential ogic Technologies ast ecture Moore and Mealy Machines Today uential logic technologies Ving machine: Moore to synch. Mealy OPEN = creates

More information

ECE 551: Digital System *

ECE 551: Digital System * ECE 551: Digital System * Design & Synthesis Lecture Set 5 5.1: Verilog Behavioral Model for Finite State Machines (FSMs) 5.2: Verilog Simulation I/O and 2001 Standard (In Separate File) 3/4/2003 1 Explicit

More information

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques FSM Components XST features: Specific inference capabilities for synchronous Finite State Machine (FSM) components. Built-in FSM encoding strategies to accommodate your optimization goals. You may also

More information

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution 5.3(a)(2), 5.6(c)(2), 5.2(2), 8.2(2), 8.8(2) The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 25 Homework #6 Solution 5.3 (a) For the following SM chart:

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

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

Sequential Logic - Module 5

Sequential Logic - Module 5 Sequential Logic Module 5 Jim Duckworth, WPI 1 Latches and Flip-Flops Implemented by using signals in IF statements that are not completely specified Necessary latches or registers are inferred by the

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

ECE Digital Design Laboratory. Lecture 3 Finite State Machines!

ECE Digital Design Laboratory. Lecture 3 Finite State Machines! ECE 4401 - Digital Design Laboratory Lecture 3 Finite State Machines! 1!!!! Synchronous Sequential Circuits!!! Synchronous sequential logic circuits are realized using combinational logic and storage elements

More information

Finite-State Machine (FSM) Design

Finite-State Machine (FSM) Design 1 Finite-State Machine (FSM) Design FSMs, an important category of sequential circuits, are used frequently in designing digital systems. From the daily used electronic machines to the complex digital

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

Sequential Logic Implementation. Mealy vs. Moore Machines. Specifying Outputs for a Mealy Machine. Specifying Outputs for a Moore Machine

Sequential Logic Implementation. Mealy vs. Moore Machines. Specifying Outputs for a Mealy Machine. Specifying Outputs for a Moore Machine uential Logic Implementation! Models for representing sequential circuits " bstraction of sequential elements " Finite state machines and their state diagrams " Inputs/ " Mealy, Moore, and synchronous

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

Modeling Sequential Circuits in Verilog

Modeling Sequential Circuits in Verilog Modeling Sequential Circuits in Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Presentation Outline Modeling Latches and Flip-Flops Blocking versus

More information

Sequential Statement

Sequential Statement Sequential Statement Sequential Logic Output depends not only on current input values but also on previous input values. Are building blocks of; Counters Shift registers Memories Flip flops are basic sequential

More information

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited April 2, 2009 John Wawrzynek Spring 2009 EECS150 - Lec20-fsm Page 1 Finite State Machines (FSMs) FSM circuits are a type of sequential

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

[VARIABLE declaration] BEGIN. sequential statements

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

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

Programable Logic Devices

Programable Logic Devices Programable Logic Devices In the 1970s programmable logic circuits called programmable logic device (PLD) was introduced. They are based on a structure with an AND- OR array that makes it easy to implement

More information

DIGITAL SYSTEM DESIGN

DIGITAL SYSTEM DESIGN DIGITAL SYSTEM DESIGN Prepared By: Engr. Yousaf Hameed Lab Engineer BASIC ELECTRICAL & DIGITAL SYSTEMS LAB DEPARTMENT OF ELECTRICAL ENGINEERING Digital System Design 1 Name: Registration No: Roll No: Semester:

More information

Digital Integrated Circuits

Digital Integrated Circuits Digital Integrated Circuits Lecture 4 Jaeyong Chung System-on-Chips (SoC) Laboratory Incheon National University BCD TO EXCESS-3 CODE CONVERTER 0100 0101 +0011 +0011 0111 1000 LSB received first Chung

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

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

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

VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University

VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University 1 The Wait Statement Syntax wait until condition; Different forms wait until(clk event and clk = 1 ); wait

More information

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits M1 Informatique / MOSIG Introduction to Modeling and erification of Digital Systems Part 4: HDL for sequential circuits Laurence PIERRE http://users-tima.imag.fr/amfors/lpierre/m1arc 2017/2018 81 Sequential

More information

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004 The University of Alabama in Huntsville ECE Department CPE 526 01 Final Exam Solution Spring 2004 1. (15 points) An old Thunderbird car has three left and three right tail lights, which flash in unique

More information

Latch Based Design (1A) Young Won Lim 2/18/15

Latch Based Design (1A) Young Won Lim 2/18/15 Latch Based Design (1A) Copyright (c) 2015 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any

More information

Problem Set 3 Solutions

Problem Set 3 Solutions Problem Set 3 Solutions ECE 551: Digital System Design and Synthesis Fall 2001 Final Version 1) For each of the following always behaviors: a) Does the given always behavior need a default statement as

More information

HDL Design Cube. Synthesis and VHDL

HDL Design Cube. Synthesis and VHDL HDL Design Cube time causality (algorithmic level) timing clock related (register-transfer level) propagation delay (gate level) structure dataflow behavior bit values view composite bit values values

More information

RealDigital. Problem Set #7 S1 S2 S3 Y Z X Y + Y Z X Z

RealDigital. Problem Set #7 S1 S2 S3 Y Z X Y + Y Z X Z Problem Set #7 RealDigital 1. (10 points) Modify the state diagram branching conditions in the diagrams below as needed to ensure the sum and exclusion rules are obeyed in each case. You can add a holding

More information

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis Jan 31, 2012 John Wawrzynek Spring 2012 EECS150 - Lec05-verilog_synth Page 1 Outline Quick review of essentials of state elements Finite State

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

Field Programmable Gate Array

Field Programmable Gate Array Field Programmable Gate Array System Arch 27 (Fire Tom Wada) What is FPGA? System Arch 27 (Fire Tom Wada) 2 FPGA Programmable (= reconfigurable) Digital System Component Basic components Combinational

More information

ECEN : Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University. Homework #1 Solutions

ECEN : Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University. Homework #1 Solutions ECEN 449 749: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University Homework #1 Solutions Upload your homework solution to ecampus as a single pdf file. Your

More information

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

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

Verilog for Synthesis Ing. Pullini Antonio

Verilog for Synthesis Ing. Pullini Antonio Verilog for Synthesis Ing. Pullini Antonio antonio.pullini@epfl.ch Outline Introduction to Verilog HDL Describing combinational logic Inference of basic combinational blocks Describing sequential circuits

More information

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed.

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed. VLSI SYSTEM DESIGN Prepared By: Engr. Yousaf Hameed Lab Engineer BASIC ELECTRICAL & DIGITAL SYSTEMS LAB DEPARTMENT OF ELECTRICAL ENGINEERING VLSI System Design 1 LAB 01 Schematic Introduction to DSCH and

More information

Digital Integrated Circuits

Digital Integrated Circuits Digital Integrated Circuits Lecture 5 Jaeyong Chung System-on-Chips (SoC) Laboratory Incheon National University MULTIPLE initial/always In C (single-threaded), a single statement is being executed at

More information

EE178 Lecture Verilog FSM Examples. Eric Crabill SJSU / Xilinx Fall 2007

EE178 Lecture Verilog FSM Examples. Eric Crabill SJSU / Xilinx Fall 2007 EE178 Lecture Verilog FSM Examples Eric Crabill SJSU / Xilinx Fall 2007 In Real-time Object-oriented Modeling, Bran Selic and Garth Gullekson view a state machine as: A set of input events A set of output

More information

Inferring Storage Elements

Inferring Storage Elements Inferring Storage Elements In our designs, we usually use flip-flops as our storage elements. Sometimes we use latches, but not often. Latches are smaller in size, but create special, often difficult situations

More information

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013 EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013 Print Here Student ID Signature This is a closed book exam. The exam is to be completed in one-hundred ten (110) minutes. Don t use scratch

More information

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems EE 3610: Digital Systems 1 Lecture 4: Modeling in VHDL (Continued ) Sequential Statements Use Process process (sensitivity list) variable/constant declarations Sequential Statements end process; 2 Sequential

More information

Lecture 32: SystemVerilog

Lecture 32: SystemVerilog Lecture 32: SystemVerilog Outline SystemVerilog module adder(input logic [31:0] a, input logic [31:0] b, output logic [31:0] y); assign y = a + b; Note that the inputs and outputs are 32-bit busses. 17:

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

C A R L E T O N U N I V E R S I T Y. FINAL EXAMINATION April Duration: 3 Hours No. of Students: 108

C A R L E T O N U N I V E R S I T Y. FINAL EXAMINATION April Duration: 3 Hours No. of Students: 108 C A R L E T O N U N I V E R S I T Y FINAL EXAMINATION April 2011 Duration: 3 Hours No. of Students: 108 Department Name & Course Number: ELEC 3500 Digital Electronics Course Instructor(s): Ralph Mason

More information

Finite State Machines

Finite State Machines Lab Workbook Introduction (FSM) are sequential circuit used in many digital systems to control the behavior of systems and dataflow paths. Examples of FSM include control units and sequencers. This lab

More information

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8 CSCB58 - Lab 3 Latches, Flip-flops, and Registers Learning Objectives The purpose of this exercise is to investigate the fundamental synchronous logic elements: latches, flip-flops, and registers. Prelab

More information

Problem Set 2 Solutions

Problem Set 2 Solutions Problem Set 2 Solutions ECE 551: Digital System Design and Synthesis Fall 2001 1. A tabular description and a known good behavioral specification is given for a priority encoder. x indicates don t care

More information

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date:

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date: Design of Datapath Controllers and Sequential Logic Lecturer: Date: 2009.03.18 ACCESS IC LAB Sequential Circuit Model & Timing Parameters ACCESS IC LAB Combinational Logic Review Combinational logic circuits

More information

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016 The University of Alabama in Huntsville ECE Department CPE 526 01 Midterm Exam Solution Spring 2016 1. (15 points) Write a VHDL function that accepts a std_logic_vector of arbitrary length and an integer

More information

Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm. Lecture 3

Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm. Lecture 3 Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm Lecture 3 Lecture 3 Topics Covered: Chapter 4 Discuss Sequential logic Verilog Coding Introduce Sequential coding Further review of Combinational Verilog

More information

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines ECE 2300 Digital Logic & Computer Organization Spring 2018 More Finite State Machines Lecture 9: 1 Announcements Prelab 3(B) due tomorrow Lab 4 to be released tonight You re not required to change partner(s)

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

Timing in synchronous systems

Timing in synchronous systems BO 1 esign of sequential logic Outline Timing in synchronous networks Synchronous processes in VHL VHL-code that introduces latches andf flip-flops Initialization of registers Mealy- and Moore machines

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

Lab 3. Advanced VHDL

Lab 3. Advanced VHDL Lab 3 Advanced VHDL Lab 3 Advanced VHDL This lab will demonstrate many advanced VHDL techniques and how they can be used to your advantage to create efficient VHDL code. Topics include operator balancing,

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

One and a half hours. Section A is COMPULSORY

One and a half hours. Section A is COMPULSORY One and a half hours Section A is COMPULSORY An additional answersheet is provided for Question 4. Please remember to complete the additional answersheet with your University ID number and attach it to

More information

Finite State Machines

Finite State Machines Finite State Machines Design methodology for sequential logic -- identify distinct states -- create state transition diagram -- choose state encoding -- write combinational Verilog for next-state logic

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

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL DESCRIPTION OF DIGITAL CIRCUITS USING VHDL Combinatinal circuits Sequential circuits Design organization. Generic design Iterative operations Authors: Luis Entrena Arrontes, Celia López, Mario García,

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

Laboratory Exercise 3

Laboratory Exercise 3 Laboratory Exercise 3 Latches, Flip-flops, and egisters The purpose of this exercise is to investigate latches, flip-flops, and registers. Part I Altera FPGAs include flip-flops that are available for

More information

- 1 of 18 - The Verilog Hardware Description Language - A Behavioural View Overview. The Behavioural Model

- 1 of 18 - The Verilog Hardware Description Language - A Behavioural View Overview. The Behavioural Model The Verilog Hardware Description Language - A Behavioural View Overview In this lesson we will Introduce and explore the Verilog behavioural level model. Introduce the behavioural operators. Study the

More information

Lecture 08 Finite State Machine Design Using VHDL

Lecture 08 Finite State Machine Design Using VHDL Lecture 08 Finite State Machine Design Using VHDL 10/1/2006 ECE 358: Introduction to VHDL Lecture 8-1 Today Sequential digital logic system design state diagram/state graph 10/1/2006 ECE 358: Introduction

More information

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control ECE 4514 Digital Design II Lecture 15: FSM-based Control A Design Lecture Overview Finite State Machines Verilog Mapping: one, two, three always blocks State Encoding User-defined or tool-defined State

More information

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS YEAR / SEM: II / IV UNIT I BOOLEAN ALGEBRA AND COMBINATIONAL

More information

Last Lecture. Talked about combinational logic always statements. e.g., module ex2(input logic a, b, c, output logic f); logic t; // internal signal

Last Lecture. Talked about combinational logic always statements. e.g., module ex2(input logic a, b, c, output logic f); logic t; // internal signal Last Lecture Talked about combinational logic always statements. e.g., module ex2(input logic a, b, c, output logic f); logic t; // internal signal always_comb t = a & b; f = t c; should use = (called

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

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

EECS 270 Verilog Reference: Sequential Logic

EECS 270 Verilog Reference: Sequential Logic 1 Introduction EECS 270 Verilog Reference: Sequential Logic In the first few EECS 270 labs, your designs were based solely on combinational logic, which is logic that deps only on its current inputs. However,

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

8 Register, Multiplexer and

8 Register, Multiplexer and 8 Register, Multiplexer and Three-State Inference HDL Compiler can infer Registers (latches and flip flops) Multiplexers Three state gates This chapter discusses methods of inferring different types of

More information

Quick Introduction to SystemVerilog: Sequental Logic

Quick Introduction to SystemVerilog: Sequental Logic ! Quick Introduction to SystemVerilog: Sequental Logic Lecture L3 8-545 Advanced Digital Design ECE Department Many elements Don Thomas, 24, used with permission with credit to G. Larson Today Quick synopsis

More information

Code No: R Set No. 1

Code No: R Set No. 1 Code No: R059210504 Set No. 1 II B.Tech I Semester Supplementary Examinations, February 2007 DIGITAL LOGIC DESIGN ( Common to Computer Science & Engineering, Information Technology and Computer Science

More information

FSM$Modeling. Controller$Implementation

FSM$Modeling. Controller$Implementation FSM$Modeling State$Diagrams$(SDs)$and$Algorithmic$State$ Machine$(ASM)$charts$Describe$Behavior$of$FSMs Translating$Directly$from$SD/ASMs$to$Verilog$is$ Advantageous No$Worry$about$Mistake$in$Logic$Simplification

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

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

Designing Safe Verilog State Machines with Synplify

Designing Safe Verilog State Machines with Synplify Designing Safe Verilog State Machines with Synplify Introduction One of the strengths of Synplify is the Finite State Machine compiler. This is a powerful feature that not only has the ability to automatically

More information

CMPE 415 Verilog Case-Statement Based State Machines I

CMPE 415 Verilog Case-Statement Based State Machines I Department of Computer Science and Electrical Engineering CMPE 415 Verilog Case-Statement Based State Machines I Prof Ryan Robucci Basic State Machines Mealy Machine a/q0 c/q3 a/q0 a,b,c/q4 S0 S1 S2 b/q2

More information

EE 231 Fall EE 231 Homework 13 Due December 3, 2010

EE 231 Fall EE 231 Homework 13 Due December 3, 2010 EE 23 Fall 2 EE 23 Homework 3 Due December 3, 2. Explain in words and write the HDL statements for the operations specified by the following register transfer notations; (a) R R, R2 R Transfer the contents

More information

Modeling of Finite State Machines. Debdeep Mukhopadhyay

Modeling of Finite State Machines. Debdeep Mukhopadhyay Modeling of Finite State Machines Debdeep Mukhopadhyay Definition 5 Tuple: (Q,Σ,δ,q 0,F) Q: Finite set of states Σ: Finite set of alphabets δ: Transition function QχΣ Q q 0 is the start state F is a set

More information

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now? Outline EECS 5 - Components and Design Techniques for Digital Systems Lec Putting it all together -5-4 David Culler Electrical Engineering and Computer Sciences University of California Berkeley Top-to-bottom

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

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID: EEL 4712 Midterm 1 Spring 2012 VERSION 1 Name: UFID: 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

More information

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1 ACS College of Engineering Department of Biomedical Engineering Logic Design Lab pre lab questions (2015-2016) Cycle-1 1. What is a combinational circuit? 2. What are the various methods of simplifying

More information

Sequential Logic Design

Sequential Logic Design Sequential Logic Design Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan) http://www.syssec.ethz.ch/education/digitaltechnik_17 Adapted

More information

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS Note: Closed book no notes or other material allowed apart from the one

More information

N-input EX-NOR gate. N-output inverter. N-input NOR gate

N-input EX-NOR gate. N-output inverter. N-input NOR gate Hardware Description Language HDL Introduction HDL is a hardware description language used to design and document electronic systems. HDL allows designers to design at various levels of abstraction. It

More information

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture Assignment Last time Project 4: Using synthesis tools Synplify Pro and Webpack Due 11/11 ning of class Generics Used to parameterize models E.g., Delay, bit width Configurations Configuration specification

More information

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters.

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters. ECE 55 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks Required reading P. Chu, RTL Hardware esign using VHL Chapter 5.1, VHL Process Chapter 8, Sequential Circuit esign: Principle

More information