Question

Write a VHDL code for a 4-bit shift register that shifts from right to left.

Write a VHDL code for a 4-bit shift register that shifts from right to left.

Homework Answers

Answer #1

The VHDL code is

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity shiftreg is
port(   clk,x: in std_logic;     --x is the input signal inserted at the left side
        Q: out std_logic_vector(3 downto 0));          
end shiftreg;
architecture Behavioral of shiftreg is
signal S:std_logic_vector(3 downto 0);
begin
process(x,clk)
begin
S<="0000";
if(clk'event and clk='1')then
S<=S(2 downto 0)&x;
end if;
end process;
Q<=S;
end Behavioral;

(rotate operation is diffrent from shifting operation)

(If you have any query leave a comment, Thank you)

Know the answer?
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
Similar Questions
write the truth table of 3-(7494) of 4 bit shift register using VHDL Behavioral style of...
write the truth table of 3-(7494) of 4 bit shift register using VHDL Behavioral style of modeling.
design 4 bit shift register IC 5495 using behavioral style in VHDL
design 4 bit shift register IC 5495 using behavioral style in VHDL
Could someone show me how to write VHDL code for the following logical Shifts. Please use...
Could someone show me how to write VHDL code for the following logical Shifts. Please use concatenation. signal x:std_logic_vector(7 downto 0):"01000101"; 1) Logical right shift of 2. 2) Logical right shift of 5. 3) Logical left shift of 2. 3) Logical left shift of 3.
matlab code for a 4 bit parallel in serial out shift register
matlab code for a 4 bit parallel in serial out shift register
Model 74LS164- an 8-Bit Serial In/Parallel Out Shift Register using behavioral style using VHDL, create a...
Model 74LS164- an 8-Bit Serial In/Parallel Out Shift Register using behavioral style using VHDL, create a test bench to apply various stimulus to it, and demonstrate its functionality for various test cases through simulated waveform and configuration on the DE2-115 target board.
Write the VHDL code implementing a 6-bit synchronous counter with enable. The design should include the...
Write the VHDL code implementing a 6-bit synchronous counter with enable. The design should include the output to be connected to the next stage Then update the code to include an asynchronous reset
Write a HDLcode for an 8 bit shift register with a reset pin. for system verilog...
Write a HDLcode for an 8 bit shift register with a reset pin. for system verilog please
Design a 6-bit, shift-right register with D flip flops, and use it to implement a circuit...
Design a 6-bit, shift-right register with D flip flops, and use it to implement a circuit that detects the sequence “010010” (the rightmost bit is the first arriving). Information shifts one position right when a positiv edge of clk occurs The circuit has the following inputs and outputs (use exactly these names for inputs and outputs. Respect upper and lower case): clk: Input. Clock signal. RST: Reset signal. When RST = 1 flip flops are reset to 0. IN: Data...
Write a VHDL code for a Traffic Light
Write a VHDL code for a Traffic Light
A 4-Bit binary counter: A register containing 4 bits, all initialized to zero. The bits increment...
A 4-Bit binary counter: A register containing 4 bits, all initialized to zero. The bits increment by 1 every 10 nanoseconds at each iteration until it gets to all ones in the 4-bit positions. Write the Verilog code and testbench for the 4-bit binary counter.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT