ceg3155Assignment3Solutions
ceg3155Assignment3Solutions
(Fall 2024)
Prof. Rami Abielmona
Possible Solutions Assignment #3: Sequential
Circuits Concepts
November 5, 2024
Question I
This question is concerned with the state table reduction using the method of
division of equivalence of class. Part c is question 6.18 of your textbook.
Part a
The partitions for this state table are::
Π1 = (ABCDEF GH)
Π2 = (ACDE)(BF G)(H)
Π3 = (ACDE)(BG)(F )(H)
Π4 = (ACE)(D)(BG)(F )(H)
Π5 = (ACE)(D)(BG)(F )(H)
Part b
The partitions for this state table are:
Π1 = (ABCDEF GH)
1
Present Next State Yield
State x=0 x=1
y2 y1 y0 Y2 Y1 Y0 Y2 Y1 Y0 x=0 x=1
A B A 0 0
B A D 1 0
D F A 0 0
F F H 1 0
H D F 1 1
Π2 = (ACEF H)(BDG)
Π3 = (AEF )(CH)(BG)(D)
Π4 = (AEF )(CH)(BG)(D)
Part c
The partitions for this state table are:
Π1 = (ABCDEF G)
Π2 = (ADG)(BCEF )
Π3 = (AG)(D)(B)(CE)(F )
Π4 = (A)(G)(D)(B)(CE)(F )
Π5 = (A)(G)(D)(B)(CE)(F )
2
the state E with C, we obtain the reduced table which is shown in table
3.
Present Next State Yield
State x=0 x=1
y2 y1 y0 Y2 Y1 Y0 Y2 Y1 Y0 x=0 x=1
A B C 0 0
B D - 0 1
C F C 0 1
D B G 0 0
F C D 0 1
G F - 0 0
Question II
This question is concerned with the design using the FSM method. Parts a and
b are questions 6.37 and 6.38 of your textbook.
Part a
To ensure that device 3 will get the bus, the FSM must be modified
as follows (figure 1).
Part b
The entity questionIIb is encoded in VHDL as below:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY questionIIb IS
PORT (i_clock : IN STD_LOGIC;
i_resetb : IN STD_LOGIC;
i_r : IN STD_LOGIC_VECTOR(1 to 3);
o_g : OUT STD_LOGIC_VECTOR(1 to 3));
END questionIIb;
BEGIN
3
Figure 1: Arbiter FSM without famine
4
int_state <= gnt2;
ELSIF i_r(3) = ’1’ THEN
int_state <= gnt3;
ELSE int_state<= Idle;
END IF;
WHEN gnt2 =>
IF i_r(2) = ’1’ THEN
int_state <= gnt2;
ELSIF i_r(3) = ’1’ THEN
int_state <= gnt3;
ELSE int_state<= Idle;
END IF;
WHEN gnt3 =>
IF i_r(3) = ’1’ THEN
int_state <= gnt3;
ELSE int_state <= Idle;
END IF;
END CASE;
END IF;
END PROCESS;
Part c
Let’s start by building a state diagram with the given specifications.
The diagram contains four states: A to indicate that we have not received
our first ’0’, B to indicate that we received it, C to indicate that
we have not received a second ’0’, and D indicate that we received
it. Then the state diagram can be seen in the figure 2. See that
we chose a Moore machine because we can simplify our excitement expressions.
We can convert our state diagram into a state table. The table
is shown in table 4.
Let’s try to reduce our state table using the method of dividing
equivalence of class. Our partitions are:
Π1 = (ABCD)
Π2 = (ABC)(D)
Π3 = (AB)(C)(D)
5
Figure 2: State Diagram
Π4 = (A)(B)(C)(D)
Finally, we arrive with our design equations for our next state
variable and our output from of the system. Note that since this machine
6
is a Moore type, the output depends on the present variable only. Check
the figure 3 for the final circuit realized with two D-type flip-flops.
Y1 = y1 + y0 · x (1)
Y0 = x + y1 · y0 (2)
z = y1 · y0 (3)
Question III
This question is concerned with state transition tables.
Part a
The transition table for a sequential encoding is shown in table 6
For the realization of D flip-flops, the table of excitement is
the same as table 6, while the design equations become:
Y2 = y1 · y0 · x (4)
Y1 = y2 + y1 · x + y1 · y0 · x (5)
Y0 = y2 · x + y1 · x + y2 · y0 · x (6)
z = y2 + y0 · x (7)
For the realization of S-R flip-flops, the table of excitement is
shown in table 7, then that the design equations become:
7
Present Next State Yield
State x=0 x=1
y2 y1 y0 Y2 Y1 Y0 Y2 Y1 Y0 x=0 x=1
A → 000 001 000 0 0
B → 001 000 010 1 0
C → 010 011 000 0 0
D → 011 011 100 1 0
E → 100 010 011 1 1
S2 = y1 · y0 · x (8)
R2 = y0 (9)
S1 = y2 + y1 · y0 · x (10)
R1 = y1 · x (11)
S0 = y2 · x + y2 · y0 · x (12)
R0 = y1 · y0 + y0 · x (13)
z = y2 + y0 · x (14)
Part b
By applying the rules of contiguities, we obtain the following conditions:
Rule II (A, B), (A, C), (A, D), (D, E), (C, D)
Rule III (B, D, E)
8
Present Next State Yield
State x=0 x=1
y1 y0 y2 y1 y0 Y2 Y1 Y0 Y2 Y1 Y0 x=0 x=1
y2 00 01 10 11 A → 000 001 000 0 0
0 A B - - B → 001 000 100 1 0
1 C D E - C → 100 101 000 0 0
D → 101 101 111 1 0
E → 111 100 101 1 1
Check the table 8 for the assignment card of states for this state
table, as well as the transition table.
For the realization of the D flip-flop, the design equations are:
Y2 = y2 · x + y0 · x (15)
Y1 = y2 · y1 · y0 · x (16)
Y0 = y0 · x + y1 · x + y2 · y1 · y0 (17)
z = y1 + y0 · x (18)
Finally, for the realization of a S-R flip-flop, the excitement
table is shown in table 9, and the design equations are:
S2 = y0 · x (19)
R2 = y0 · x (20)
S1 = y2 · y1 · y0 · x (21)
R1 = y1 (22)
S0 = y0 · x (23)
R0 = y2 · y0 + y1 · x (24)
z = y2 + y0 · x (25)
9
Thanks
The answers and figures related to the questions in the manual are taken from
the accompanying instructor’s manual for Fundamentals of Digital Logic with
VHDL Design by Stephen Brown and Zvonko Vranesic.
The answers to the third question are taken from the accompanying instruc-
tor’s manual for Digital Principles and Design by Donald D. Givone.
10