Please Write it in VHDL and complete the following code
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity regs is
port ( clk, en, rst : in std_logic;
id1, id2 : in std_logic_vector (4 downto 0);
wr_en1, wr_en2 : in std_logic;
din1, din2 : in std_logic_vector (15 downto 0);
dout1, dout2 : out std_logic_vector (15 downto 0)
);
end regs;
architecture arch of regs is
type ram_memory is array (31 downto 0) of std_logic_vector (15 downto 0);
signal memory : ram_memory;
signal addr1, addr2 : std_logic_vector (4 downto 0);
begin
process (clk, rst)
begin
if (rst = '1') then
memory <= (others => (others => '0'));
elsif rising_edge (clk) then
if (en = '1') then
if (wr_en1 = '1') then
memory(to_integer(unsigned(id1))) <= din1;
end if;
if (wr_en2 = '1') then
memory(to_integer(unsigned(id2))) <= din2;
end if;
end if;
addr1 <= id1;
addr2 <= id2;
end if;
end process;
dout1 <= memory(to_integer(unsigned(addr1)));
dout2 <= memory(to_integer(unsigned(addr2)));
end arch;
Please Write it in VHDL and complete the following code Create an entity called "regs" where...
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...
Write a VHDL code using processes for the following logic circuit which include a shift register and 4x1 multiplexer. Use the entity below. entity registers_min_max is port( din : in std_logic_vector(3 downto 0); reset : in std_logic; clk : in std_logic; sel : in std_logic_vector(1 downto 0); reg_out : out std_logic_vector(3 downto 0)); end registers_min_max; din reset RO clk reset R1 A C clk reset R2 clk reset R3 clk 3 0 sel LE
Problem 2 (15 points) wo components, component A 4 and component B, are declared as follows COMPONENT A IS PORT(clk, rst: IN std logic; END COMPONENT COMPONENT B IS rst m: OUT std_logic vector 1 DOWNTO 0)); PORT(d: IN std logic; END COMPONENT Write a complete VHDL program that implements the circuit shown below. Use good style, especially f: OUT std logic vector(1 DOWNTO 0)): f(0) indenting. (Note that this time, it needs to be a complete program.) y(2) 0
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"...
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;...
in vhdl Manchester code is a coding scheme used to represent a bit in a data stream. A 'O' value of a bit is represented as a 0-to-1 transition in which the lead half is 'O' and the remaining half is '1'. Similarly, a '1' value of a bit is represented as a 1-to-transition, in which the lead half is 'l' and the remaining half is 0 For example, for the input string "110", the output is translated as: 110...
b. Suppose you are provided with a 4-bit ripple carry adder. It has the following entity declaration and schematic representation А(3:0] B[3: entity fourbit FA is portA, B in std logic_vector (3 downto 0); 4-bit RCA Cin in std_logic; S out stdlogic_vector (3 downto 0) Cout out std logic: Cin Cout S3:0] end fourbitFA Create a VHDL architecture for the following circuit (15 Marks) C3:0] D[3:0] A[3:0] B[3:0] Е[3:0] F[3:0] 4-bit RCA 4-bit RCA inA 4-bit RCA CinB CinC Coutl...
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...
Please write the code in VHDL 1. An entity named reorder has an 8-bit std_logic_vector input and an 8-bit std logic_ vector output. The bits of the entity's output vector have the reverse order of the bits of its input vector. The architecture must use a single concurrent call to a function The function, named reorder_vec, is defined in the declaration section and returns a std_logic vector whose bits have the reverse order of the bits in the std_logic vector...
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...