program: design 1: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity mod10_counter is port( clk, reset: in std_logic; q: out std_logic_vector(3 downto 0) ); end mod10_counter; architecture two_seg_arch of mod10_counter is constant TEN: integer := 10; signal r_reg: unsigned(3 downto 0); signal r_next: unsigned(3 downto 0); begin -- register process(clk,reset) begin if (reset='1') then r_reg <= (others=>'0'); elsif (clk'event and clk='1') then r_reg <= r_next; end if; end process; -- next-state logic r_next <= (others=>'0') when r_reg=(TEN-1) else r_reg + 1; -- output logic q <= std_logic_vector(r_reg); end two_seg_arch;
Design2:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity test is
port (
clk : in std_logic;
bcd : in std_logic_vector(3 downto 0); --BCD input
segment7 : out std_logic_vector(6 downto 0) -- 7 bit decoded
output.
);
end test;
--'a' corresponds to MSB of segment7 and g corresponds to LSB of
segment7.
architecture Behavioral of test is
begin
process (clk,bcd)
BEGIN
if (clk'event and clk='1') then
case bcd is
when "0000"=> segment7 <="0000001"; -- '0'
when "0001"=> segment7 <="1001111"; -- '1'
when "0010"=> segment7 <="0010010"; -- '2'
when "0011"=> segment7 <="0000110"; -- '3'
when "0100"=> segment7 <="1001100"; -- '4'
when "0101"=> segment7 <="0100100"; -- '5'
when "0110"=> segment7 <="0100000"; -- '6'
when "0111"=> segment7 <="0001111"; -- '7'
when "1000"=> segment7 <="0000000"; -- '8'
when "1001"=> segment7 <="0000100"; -- '9'
--nothing is displayed when a number more than 9 is given as
input.
when others=> segment7 <="1111111";
end case;
end if;
end process;
end Behavioral;
Design C-1 (modulo-10 up-counter): Using the behavioral VHDL coding, create an up-counter to count upward. The...
Design in VHDL a 4-bit up-down counter as presented below:
The operation of the up-down counter is described by the
following truth table:
S1 S0
Action
0 0
Hold
0 1
Count up
1 0
Count down
1 1
Parallel Load
Provide VHDL code and testbench
XЗ Q3 X3X2X1X0 Parallel Load X2 S1SO Function Select Input Q2 RST-Asynchronous Reset Input X1 CLK- Clock Input Q1 хо Q3Q2Q1Q0 - Parallel Output Q0 CLK S1 S0 RST
XЗ Q3 X3X2X1X0 Parallel Load...
Using VHDL language, design, simulate and implement a “2-Digit up/down BCD seconds counter with reset button”circuit. The counter value must be automatically incremented/decremented twice every second (slow down the clock to 2 Hz). The up counting or down counting is determined by the status of a toggle switch on DE10-Lite board. If the toggle switch is set to logic 0 , the counter should count down and vice versa. In the up counting mode, if the counter reaches “59”, the...
Q3. Synchronous Counter Figure 8.3(a) shows a modulo-8 synchronous up-counter (Modulo-8 because this counter can count only from 0 to 7 with its 3 bits qo, q1 and 92.). Treat each gray cell in the figure as a component and write generic VHDL codes to create a modulo-2N counter, where N is the number of flip-flops required. Use nominal mapping for this problem while instantiating components. When the asynchronous reset signal rst is high, the counter is set to 0...
Consider the circuit in Figure 1. It is a 4-bit (QQ2Q3) synchronous counter which uses four T-type flip-flops. The counter increases its value on each positive edge of the clock if the Enable signal is asserted. The counter is reset to 0 by setting the Clear signal low. You are to implement an 8-bit counter of this type Enable T Q Clock Clear Figure 1. 4-bit synchronous counter (but you need to implement 8-bit counter in this lab) Specific notes:...
Just need the code for the
random counter,Thanks
Objective: In this lab, we will learn how we can design sequential circuits using behavioral modelling, and implementing the design in FPGA. Problem: Design a random counter with the following counting sequence: Counting Sequence: 04 2 9 168573 Design Description: The counter has one clock (Clock), one reset (Reset), and one move left or right control signal (L/R) as input. The counter also has one 4bit output O and one 2bit output...
Use a behavioral Verilog model to design a 3-bit fault tolerant up-down counter. For each flip-flop (FF) include asynchronous reset and preset signals. Refer to Example 4.3 on page 160 for an example of a single FF with both reset and preset signals as well as with an enable signal. For this project, you don't need to use FFs with enables. You don't also need not-q (nq) in this assignment. Use active-high signals for reset and present signals. The example...
Q3: Using VHDL code, design a 4 bit BCD up counter using sequential statements (30 Marks) 0 012 03 C FF3 c( FFO
Q3: Using VHDL code, design a 4 bit BCD up counter using sequential statements (30 Marks) 0 012 03 C FF3 c( FFO
Design a modulo-11 up/down counter using a regular modulo-16
counter and any combinational logic. The modulo-11 up/down counter
has four modes; count up by 1, count up by 2, count down by 1, and
no count. A formal description of the modulo-11 up/down counter is
shown below.
Inputs: ctrL0, ctrl-1 є {0, 1} State/Output:s (0,1, 10) The state transition function is defined as: s(t) if ctrl-0-0 and ctrl-1 = 0 (s(t)+ 1) mod 11 ifctl_0-0 and ctrl 1-1 s(t+1(s(t)+2) mod1...
This is a subject on "Design of logic systems", using VHDL
codes. Thank you.
Also, note that the limitations that I cannot use vector in the
input and output variables. Thank you
ww DECADE achive vhdk design exty Clock D> /clock ResePeset chel asvn COUNTER o2 INI Op 1' → Count up > count down gates the rect nunber for fium Oto and 'E' for ofther b'harj b LED ghtue when ceunt down to Yoood or count number IAN 3...
Problem 8 (Lab, 20 points) (1) Write a VHDL module implementing a synchronous 16-bit counter. A "reset signal resets the counter to 0. An "en" signal enables the counter modification. An "up signal indicates whether the counter must be incremented (1)/decremented (0). (2) The output of the module is the value of the signal, represented as 16 bits wide. Using output timing diagram to verify your coding results.