Question

In: Electrical Engineering

Write a verilog code for digital clock and display it’s seven segment using fpga?

Write a verilog code for digital clock and display it’s seven segment using fpga?

Solutions

Expert Solution

verilog code :

library IEEE

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.numeric_std.all;

entity digital_clock is

port(

clk: in std_logic;

rst_n: in std_logic;

H_in1: in std_logic_vector(1 downto 0);

H_in0: in std_logic_vector(3 downto 0);

M_in1: in std_logic_vector(3 downto 0);

M_in0: in std_logic_vector(3 downto 0);

H_out1: out std_logic_vector(6 downto 0);

H_out0: out std_logic_vector(6 downto 0);

M_out1: out std_logic_vector(6 downto 0);

M_out0: out std_logic_vector(6 downto0);

end digital_clock;

architecture Behavioural of digital_clock is

component bin2hex

port (

Bin : in std_logic_vector(3 downto o);

Hout out std_logic_vector(6 downto 0);

end component;

component clk_div

port(

clk_50: in std_logic;

clk_ls: out std_logic );

end component ;

signal clk_is : std_logic ;

signal H_out1_bin :std_logic_vector(3 downto 0);

signal H_out0_bin: std_logic_vector(3 downto 0);

signal M_out1_bin: std_logic_vector(3 downto 0);

signal M_out0_bin: std_logic_vector(3 downto 0);

begin

create_ls_clock:clk_div port map(clk_50 =>clk, clk_ls =>clk_ls);

process(clk_ls,rst_n) begin

if(rst_n ='0') then

counter_hour <=to_integer (unsigned(H_in1))*10+ to_integer(unsigned(H_in0));

counter_minute <=to_integer(unsigned(M_in1))*10+to_integer(unsigned(M_in0));

counter_second<=0;

elseif(rising_edge(clk_ls)) then counter_second<=counter_second+1;

if(counter_second>=59) then

counter_minute <=0;

counter_hour<=counter_hour+1;

if(counter_hour <=24) then

if(counter_hour>=24) then

counter_hour <=0;

end if;

end if;

emd if;

end if;

end process;


Related Solutions

Write VHDL code for the following: Use HEX-to-seven segment display converters to display the inputs and...
Write VHDL code for the following: Use HEX-to-seven segment display converters to display the inputs and results for a 4-bit adder. The inputs are unsigned 4-bit binary numbers. The outcome is a 4-bit binary adder with LED display. First you need to create a symbol for the HEX-to-seven segment display converter. Then implement a 4-bit adder using VHDL. Finally, connect three HEX-to-seven segment display converters to display input X, input Y, and sum S.
create verilog source files for a seven segment display using the software vivado. show your steps.
create verilog source files for a seven segment display using the software vivado. show your steps.
Make a 2 bit binary adder subtractor multiplier on verilog and display it on seven segment...
Make a 2 bit binary adder subtractor multiplier on verilog and display it on seven segment using fpga
Write a code of digital alarm clock 8051 microcontroller using pin AT89S52
Write a code of digital alarm clock 8051 microcontroller using pin AT89S52
Design a digital circuit for output ‘e’ for the seven segment display for all possible inputs....
Design a digital circuit for output ‘e’ for the seven segment display for all possible inputs. Inputs: ABCD a f b g    e c d A) Derive a truth table B) Design using K-Map technique, a minimum AND-OR gate network for this system. Draw the resulting digital circuit diagram
write the code of 4 digit 7-segment display using arduino uno in assembly language by using...
write the code of 4 digit 7-segment display using arduino uno in assembly language by using software AVR STUDIO 5.1?
I need a Verilog code that makes the LEDs on the FPGA board works like this....
I need a Verilog code that makes the LEDs on the FPGA board works like this. https://image.ibb.co/mu5tnS/6.gif There are 16 LEDs in the FPGA board
write a verilog code to implement a digital system that has an odd counter that counts...
write a verilog code to implement a digital system that has an odd counter that counts from 1 to 11. Also, this system has an output Y that detects a specific number in the odd counter. Test your code when you detect the number 3, the output Y is 1, if the counter value is set to 3, otherwise 0.
Seven Segment display is applicable for alphanumeric display both . Suppose you are appointed as an...
Seven Segment display is applicable for alphanumeric display both . Suppose you are appointed as an engineer in company, which deals in same area (Seven Segment display unit) As per customer demand, you need to design a basic logic gate circuit diagram (Combinational circuit), which having output 1 (HIGH) when a 4-bit BCD code translated to a number that uses the upper ngt segment of a single seven segment display unit
use modelsim write Verilog code for the following digital logic circuits and then simulate them by...
use modelsim write Verilog code for the following digital logic circuits and then simulate them by writing a testbench module for each of them , (a)The FSMs for the snail problem that is in the slides (a snail crawls over a tape that has 0 and 1 and smiles if it has detected the '10' bits using both Moore and Mealy FSM. Note that the pattern is '10' not '01' as in the slides. (b) A rock-paper-scissor game played by...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT