Question

Q3: Using VHDL code, design a 4 bit BCD up counter using sequential statements (30 Marks) 0 012 03 C FF3 c( FFO
0 0
Add a comment Improve this question Transcribed image text
Answer #1

4bit counter

VHDL code

library IEEE;

use IEEE.STD_LOGIC_1164.all;

use IEEE.STD_LOGIC_ARITH.all;

use IEEE.STD_LOGIC_UNSIGNED.all;

entity counter_4bit is

    port(

      clk : in STD_LOGIC;

      reset : in STD_LOGIC;

      dout : out STD_LOGIC_VECTOR(3 downto 0)

        );

end counter_4bit;

architecture counter_4bit_arc of counter_4bit is

begin

    counting : process (clk,reset) is

    variable m : std_logic_vector (3 downto 0) := "0000";

    begin

      if (reset='1') then

       m := "0000";

     elseif (rising_edge (clk)) then

       m := m + 1;

     end if;

     dout <= m;

end process counting;

end counter_4bit_arc;

Add a comment
Know the answer?
Add Answer to:
Q3: Using VHDL code, design a 4 bit BCD up counter using sequential statements (30 Marks) 0 012 03 C FF3 c( FFO...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT