a)
b)
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity stm is
port (
x,clk,reset:in std_logic;
Y:out std_logic_vector(2 downto 0)
);
end stm;
architecture Behavioral of stm is
type state is (s1,s10,s2,s20,s3,s30,s4,s40);
signal present_state,next_state:state;
begin
process(clk,reset)
begin
if (reset='1') then
present_state<=s1;
elsif rising_edge(clk) then
present_state<=next_state;
end if;
end process;
process(present_state,x)
begin
case (present_state) is
when s1 =>
if (x='0') then
next_state <= s10;
else
next_state <=s2;
end if;
when s10 =>
if (x='0') then
next_state <= s10;
else
next_state <=s1;
end if;
when s2 =>
if (x='0') then
next_state <= s20;
else
next_state <=s3;
end if;
when s20 =>
if (x='0') then
next_state <= s20;
else
next_state <=s1;
end if;
when s3 =>
if (x='0') then
next_state <= s30;
else
next_state <=s4;
end if;
when s30 =>
if (x='0') then
next_state <= s30;
else
next_state <=s1;
end if;
when s4 =>
if (x='0') then
next_state <= s40;
else
next_state <=s1;
end if;
when s40 =>
if (x='0') then
next_state <= s40;
else
next_state <=s1;
end if;
end case;
end process;
process(present_state)
begin
case (present_state) is
when s1 =>
Y<="000";
when s10 =>
Y<="000";
when s2 =>
Y<="001";
when s20 =>
Y<="001";
when s3 =>
Y<="010";
when s30 =>
Y<="010";
when s4 =>
Y<="100";
when s40 =>
Y<="100";
end case;
end process;
end Behavioral;
Consider an FSM with one input I and three outputs x, y, and z. xyz should...
Finite state machine (FSM) counter design: Gray codes have a useful property in that consecutive numbers differ in only a single bit position. Table 1 lists a 3-bit modulo 8 Gray code representing the numbers 0 to 7. Design a 3-bit modulo 8 Gray code counter FSM. a) First design and sketch a 3-bit modulo 8 Gray code counter FSM with no inputs and three outputs, the 3-bit signal Q2:0. (A modulo N counter counts from 0 to N −...
Instructor: Dr. A,Sctt 3. 130 pts. totall A "marching I's counter" outputs the following sequence in decimal 0, 4,2, 1,0,... In The counter gets its name from the binary sequence, binary the sequence is 000, 100, 010, 001, 000, where it appears that the I's are marching from left to right when the clock cycles. Design the sequential circuit to produce the counter. Derive and draw a FSM state diagram [10 points) a. b. Using D fip lops,(), g(1), (o)...
Design a Mealy FSM which functions as a sequence detector, generating two outputs y, z in the following way: a) The signal is applied sequentially to a single input line x. b) Initially both outputs y, z are set to 0. c) Output y is set to 1 when the sequence "10" has been applied to the input x; it should then be reset to 0 and the circuit should continue detecting next occurrence of "10". d) Output z is...
P5 (20 points): The following Moore FSM state table is incomplete. The clock for this FSM (FSM 1) has a period of 100 microseconds such that the button for the input X, controlled by the user, cannot be pressed for only one clock cycle. In addition, button X, when pressed, will output X=0. Current Next State Output State X=0 X=1 w A reset) o IB A B 0 D G I: Draw a state diagram for this state table. II:...
Can anyone solve this? i dont understand? verilog 1. (30 pts) Design a mod-6 counter. A mod-6 counter updates its output per clock rising edge according to the following sequence: 000, 001, 010, 011, 100, 101 (then repeat the pattern....). en is enable control (synchronous high active), resetn is reset control (asynchronous low active signal to reset counting sequence to 000) Complete the following Verilog code: en module mod6(clock, resetn, en, z); zI2:0] clock resetn Endmodule
1. FSM design. Design a clocked synchronous state machine with one input X, and an output Z. Z is 1 if 010 sequence pattern has occurred in the input X Otherwise, the output should be 0 For solution: a) Draw the state diagram. b) Write the state/output table. xcitation eqations and output equatio You do not have to draw the circuit diagram. Hint: Three states are needed (two D flip-flops) A: initial state waiting for a 0' from X B:...
Question 4 State Machines (25 marks) a. (5 marks) A 3-bit Gray code counter advances on positive clock edges and generates outputs in the sequence: 000, 001, 011, 010, 110, 111, 101, 100. Draw the assigned state table for a state machine implementing this counter. b. (10 marks) For the Gray code counter in part a, derive (unoptimised) equations for the next state as a function of the current state. c. (10 marks) Consider the following sequence detector. In each...
Name: Section Number: Lab by jeg/modified by jec 4450:220 DIGITAL LOGIC DESIGN, Spring 2018 Pre-Lab 7: Counters and Timers Week Eight Objectives To learn about binary and decade counters, and to design a one-hundred second timer. The Counter A counter is a hardware circuit whose output counts in sequence, changing at each rising has a three-bit out rolls over" back to zero to count through the sequence again. We can d edge of a clock input signal. As an example,...
9. Product State Graph ou are asked to design a sequence detector to detect the input codes 10 and 01. The input of the circuit is and the output is Z, which only changes at a clock edge. Overlaps must also be detected. Z only changes at the clock edge . [2%] A. Restate the problem by circling the most appropriate term within the parentheses 1. The circuilt type is (combinational- asynchronous- FSM). 2. The subcategory of the circuit is...
A sequential circuit has one input (X), a clock input (CLK), and two outputs (S and V). X, S and V are all one-bit signals. X represents a 4-bit binary number N, which is input least significant bit first. S represents a 4-bit binary number equal to N + 3, which is output least significant bit first. At the time the fourth input occurs, V = 1 if N + 3 is too large to be represented by 4 bits;...