0% found this document useful (0 votes)
31 views

Library IEEE Circuit - 1

The circuit takes in inputs n, d, q, resetn, and clk. It uses these inputs to generate intermediate signals x and s, where s is a shift register that shifts x on each clock cycle. The output z is determined by a logic expression that considers various bits of s.

Uploaded by

Saravana Kumar J
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Library IEEE Circuit - 1

The circuit takes in inputs n, d, q, resetn, and clk. It uses these inputs to generate intermediate signals x and s, where s is a shift register that shifts x on each clock cycle. The output z is determined by a logic expression that considers various bits of s.

Uploaded by

Saravana Kumar J
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

OUTPUT FOR THE GIVEN CIRCUIT

CODINGS FOR THE GIVEN CIRCUIT

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

---- Uncomment the following library declaration if instantiating

---- any Xilinx primitives in this code.

--library UNISIM;

--use UNISIM.VComponents.all;

entity circuit is

Port ( n : in STD_LOGIC;

d : in STD_LOGIC;

q : in STD_LOGIC;

resetn : in STD_LOGIC;

clk : in STD_LOGIC;

z : out STD_LOGIC);

end circuit;

architecture Behavioral of circuit is

signal x:std_logic_vector(4 downto 0);

signal s:std_logic_vector(5 downto 0);

begin
x(0)<=n or q;

x(1)<=d;

x(2)<=n;

x(3)<=d or q;

x(4)<=q;

process(resetn,clk)

begin

if resetn='0'then

s<="000000";

elsif clk'event and clk='0' then

s<=('0'&x)+s;

end if;

end process;

z<=((s(5) or s(4) )and (s(3) and s(2) and s(1)));

end Behavioral;

You might also like