Aziz PDF
Aziz PDF
Aziz PDF
flops. The first flip-flop is called the master flip-flop, while the second one is called the slave
flip-flop. The master-slave flip-flop is used to synchronize the data inputs and control inputs,
so that the output changes only at the rising or falling edge of the clock pulse.
where D is the input data, CLK is the clock signal, and Q is the output data.
Truth Table:
The truth table for the Master-Slave Flip Flop using D Flip Flops is as follows:
CLK D Q
0 X Q(t)
1 0 Q(t)
1 1 D(t)
where X denotes a "don't care" condition, t denotes the current time, and Q(t) denotes the
state of the output at time t.
Characteristics Table:
The characteristics table for the Master-Slave Flip Flop using D Flip Flops is as follows:
Excitation Table:
The excitation table for the Master-Slave Flip Flop using D Flip Flops is as follows:
CLK D Next State Output
Q(t+1) Q(t)
0 X Q(t) Q(t)
1 0 Q(t) Q(t)
1 1 1 0
where the excitation table shows the values of the inputs that will cause a transition from
the current state to the next state.
b) To create a timing diagram, we need to make some assumptions about the initial state of the
flip-flop, clock states, and inputs to the flip-flop. Let's assume that:
The initial state of both flip-flops is 0.
The clock signal is a square wave with a frequency of 1 Hz and a 50% duty cycle (i.e.,
equal high and low times).
The input data D is a sequence of 1010.
Timing Diagram:
Based on these assumptions, the timing diagram for the Master-Slave flip-flop using D flip-flops is as
follows:
In this timing diagram, we can see that each rising edge of the clock signal causes the first flip-flop to
sample the input data D and store it in its output Q1. Then, on the next falling edge of the clock
signal, the second flip-flop samples the output of the first flip-flop and stores it in its output Q2. As a
result, the final output sequence is 1010, which matches the input data.
c) First, let's define the states of the finite state machine. We need to keep track of the
sequence of input bits received so far, so let's define the following four states:
S0: Initial state, waiting for the first bit (0 or 1) of the input sequence.
S1: Received first bit as 1, waiting for second bit (0 or 1) of the input sequence.
S2: Received first two bits as 10, waiting for third bit (1 or 0) of the input sequence.
S3: Received first three bits as 101, waiting for fourth bit (0 or 1) of the input sequence.
Next, let's define the inputs to the finite state machine. We need to detect when the input
sequence matches the desired string "1010", so let's define the following input:
X: Input bit (0 or 1) received from the sequence.
Now, let's define the state transition table for the finite state machine:
In this state diagram, the circles represent the states, the arrows represent the state
transitions, and the labels on the arrows represent the input that triggers the transition. The
output signal Z is shown as a separate state.
With this finite state machine, when the input sequence "1010" is received in the correct
order, the output signal Z is set high (1) indicating that the desired string has been detected.
Otherwise, the output signal remains low (0).
Convert the Moore state machine to a Mealy machine. In a Mealy machine, the output is a
function of both the current state and input.