Question

Assignment: Implement an 8 bit register in VHDL/Verilog using Model Sim software. Show two test cases...

Assignment:

Implement an 8 bit register in VHDL/Verilog using Model Sim software. Show two test cases for data read and write into the register.

The register has an enable and reset signal. When the reset is high the register should be cleared. When the enable is high and reset is low, data should be written into the register.

Hint: The demo code shown below has the implementation for a 4-bit register that can be used as an example.

library ieee;

use ieee.std_logic_1164.all;

entity reg_4bit is

port (reset,enable:in bit;

clock:inout bit;

i:in bit_vector(3 downto 0);

q:out bit_vector(3 downto 0));

end entity reg_4bit;

architecture behav of reg_4bit is

begin

p1:process(clock,i,reset,enable)

begin

if (reset='1') then

q<="0000";

end if;

if (clock='1') and (reset='0') and (enable='1') then

q<=i;

end if;

end process p1;

end architecture behav;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

file dff.v

module dff(
       input clk,reset,enable,d,
       output reg Q
);
always@(posedge clk)
begin
           if(reset)
           Q <=0;
       else if(enable)
           Q <=d;
   end

endmodule

file 8_bit_reg,v

module register(
   input [7:0] in,
   input clk,
   output [7:0] out
  
);

dff u[7:0](clk,0,1,in,out);

endmodule

Add a comment
Know the answer?
Add Answer to:
Assignment: Implement an 8 bit register in VHDL/Verilog using Model Sim software. Show two test cases...
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
  • Write a test bench for the following VHDL code -------------------------------------------------------------------------------------------------------------------------------- LIBRARY ieee ; USE ieee.std_logic_1164.all ;...

    Write a test bench for the following VHDL code -------------------------------------------------------------------------------------------------------------------------------- LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY registern IS GENERIC (N: INTEGER :=4);    -- INTEGER=32, 16, ….. PORT (D           : IN STD_LOGIC_VECTOR (N-1 downto 0); clk, reset, Load   : IN      STD_LOGIC ; Q           : OUT   STD_LOGIC_VECTOR (N-1 downto 0 )) ; END registern; ARCHITECTURE behavior OF registern IS BEGIN PROCESS (clk) BEGIN IF clk' EVENT AND clk='1' THEN IF (reset ='0') THEN    --synchronous reset Q<=(OTHERS=>’0’); ELSIF (L ='0') THEN Q<=D;...

  • QUESTION 1 Complete the following peice of VHDL code with the necessary VHDL statements for a...

    QUESTION 1 Complete the following peice of VHDL code with the necessary VHDL statements for a counter that counts through this sequence(0,9,17,15,4,26) repeatedly. library IEEE use IEEE.STD_LOGIC_1164 ALL entity GCC is Port ( systemClock, reset in STD_LOGIC end GCC architecture Behavioral of GCC is stateOutput out STD LOGIC_ VECTOR (4 downto 0)) component FreqDivider is Port (systemClock in STD_LOGIC; slowClock: out STD LOGIC); end component, signal nextState, presentState: std_logic_vector(5 downto 0) := "00000"; signal slowClock: std_logic begin FD0: FreqDivider port...

  • 8.(5 points).There is an error in following VHDL code. Find the error and correct (only that...

    8.(5 points).There is an error in following VHDL code. Find the error and correct (only that line of code). LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY dec2to4 IS PORT (i IN STD LOGIC VECTOR (1 DOWNTO 0); : En IN STD_LOGIC; d OUT STD LOGIC); END dec2to4; ARCHITECTURE dataflow OF dec2to4 IS BEGIN SIGNAL Eni: STD_LOGIC_VECTOR(2 DOWNTO 0); Eni <= En & i; -concatenate signals WITH Eni SELECT d <"0001" WHEN "100" "0010" WHEN "101", "0100" WHEN "110", "1000" WHEN "111", 0000"...

  • (15 points) Your colleague is trying to code a VHDL model for a 7419 register. Review...

    (15 points) Your colleague is trying to code a VHDL model for a 7419 register. Review the code on the next page and make any and all correction correct working model. Note the function model. Note the function table and additional information regarding need to solve this problem. DL model for a 74194 4-bit bidirectional universal shift tions that are necessary to produce a al information regarding the problem that you Control Signals Mode CirN SI SO Outputs 1 1...

  • I am making a 4-bit universal shift register that can perform right shift, left shift, and...

    I am making a 4-bit universal shift register that can perform right shift, left shift, and parallel loading using 4-to-1 multiplexers in VHDL. I keep getting red lines for u3, u2, u1, u0. The error says the following below. What is wrong with my code? How can I fix it? librarviees, use ieee.std_logic_1164.all; entity uni shift.reg.is porti 1 : in std. Jogis vector (3 downto.0); I, w, clock : in std logici 9: buffer std. Jogis vector (3 downto 0));...

  • SRAP pr- Vivado 2017. Eile Edit Flow Iools Window Layout Yew HelpQuick Acces Ready VO Planning Fl...

    SRAP pr- Vivado 2017. Eile Edit Flow Iools Window Layout Yew HelpQuick Acces Ready VO Planning Flow Navigator V PROJECT MANAGER Cell Properties x Clock Regions ?-OC Package x Device xsrapvhd × Schematic X O Setings Language Templates IP Catalog IPINTEGRATOR Open Block Design Qngl3이 OutVed3이 Generate Block Design SIMULATION R3.0 Run Simulation RTL ANALYSIS n Elaborated Design 白Report Methodology Report DRC Report Noise Schematic Td Console Messages Lg Reports Design Runs Package Pins VO Ports Type here to search...

  • Please fully answer BOTH parts of the question (a) and (b). a) Draw the high level...

    Please fully answer BOTH parts of the question (a) and (b). a) Draw the high level synthesized diagram of the following VHDL code. What does the following circuit do? Write the sequence of output generated by this circuit. library ieee; use ieee.std_logic_1164.all; entity sequence is port ( cout :out std_logic_vector (3 downto 0); clk :in std_logic; reset :in std_logic ); end entity; architecture rtl of sequence is signal count :std_logic_vector (3 downto 0); begin process (clk) begin if (rising_edge(clk)) then...

  • Name: ·5. (10 lts) Find and correct errors in the following VHDL ed. IEEE ; library use IEEE . STD LOGIC-1104 . all...

    Name: ·5. (10 lts) Find and correct errors in the following VHDL ed. IEEE ; library use IEEE . STD LOGIC-1104 . all; entity cicuitl is port (a, b, elk: in STD_LOGIC: This part of the code its correct.That is, the entity definition and the 1ibraries are written correctly S out STD LOGIC) ond; architecture synth of eicuiti is begin This part of the code ธhould be a process that groups input a and input b together to forn a...

  • Write the source code for a 16-bit adder using the ‘+’ operator. Use the following information...

    Write the source code for a 16-bit adder using the ‘+’ operator. Use the following information as a guide: a. Use the names in the Adder Symbol/diagram above to name your block and its ports (all lower-case). For example dataa[15:0] signal name in VHDL would be dataa : in unsiged (15 downto 0); b. All inputs and outputs should be declared as type UNSIGNED vs STD_LOGIC_VECTOR. c. Do not worry about rollover with this adder. This adder is already wide...

  • Use the Quartus Prime Text Editor to implement a structural model of the 4-bit data register show...

    Use the Quartus Prime Text Editor to implement a structural model of the 4-bit data register shown above in a file named reg_4bit.sv. Specify the 4-bit data register’s module according to the interface specification given in the table below. Port Mode Data Type Size Description RST in logic 1-bit Active high asynchronous reset CLK in logic 1-bit Synchronizing clock signal EN in logic 1-bit Synchronous clock enable D in logic vector 4-bits Synchronous data input Q out logic vector 4-bits...

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