You are on page 1of 17

 Menu 

VHDL Code for 4-Bit Shift


Register
May 1, 2014 by Admin

Contents [hide]

1 Shift Register
2 Parallel In – Parallel Out Shift Registers
3 VHDL code for Parallel In Parallel Out Shift Register
4 Serial In – Parallel Out Shift Registers
5 VHDL Code for Serial In Parallel Out Shift Register
6 Related

Shift Register Let's Chat? - Online
VHDL Code for shift register can be categorised in serial
in serial out shift register, serial in parallel out shift
register, parallel in parallel out shift register and parallel
in serial out shift register.

Parallel In – Parallel Out Shift Registers

For parallel in – parallel out shift registers, all data bits


appear on the parallel outputs immediately following the
simultaneous entry of the data bits. The following circuit
is a four-bit parallel in – parallel out shift register
constructed by D ip- ops.

The D’s are the parallel inputs and the Q’s are the parallel
outputs. Once the register is clocked, all the data at the D
inputs appear at the corresponding Q outputs

simultaneously.
Let's Chat? - Online
VHDL code for Parallel In Parallel Out Shift
Register
1 library ieee;
2 use ieee.std_logic_1164.all;
3
4 entity pipo is
5 port(
6 clk : in std_logic;
7 D: in std_logic_vector(3 downto 0)
8 Q: out std_logic_vector(3 downto 0
9 );
10 end pipo;
11
12 architecture arch of pipo is
13
14 begin
15
16 process (clk)
17 begin
18 if (CLK'event and CLK='1') then
19 Q <= D;
20 end if;
21 end process;
22
23 end arch;

Serial In – Parallel Out Shift Registers



Let's Chat? - Online
For Serial in – parallel out shift registers, all data bits
appear on the parallel outputs following the data bits
enters sequentially through each ip op. The following
circuit is a four-bit Serial in – parallel out shift register
constructed by D ip- ops.

VHDL Code for Serial In Parallel Out Shift


Register
1 library ieee;
2 use ieee.std_logic_1164.all;
3
4 entity sipo is
5 port(
6 clk, clear : in std_logic;
7 Input_Data: in std_logic;
8 Q: out std_logic_vector(3 downto 0
9 end sipo;
10
11 architecture arch of sipo is 
12
13 begin Let's Chat? - Online
14
15 process (clk)
16 begin
17 if clear = '1' then
18 Q <= "0000";
19 elsif (CLK'event and CLK='1') then
20 Q(3 downto 1) <= Q(2 downto 0);
21 Q(0) <= Input_Data;
22 end if;
23 end process;
24 end arch;

 Download Post as PDF

Related

VHDL Code for 4-bit VHDL Code for VHDL Code for 4-Bit
Ring Counter and Binary to BCD Binary Up Counter
Johnson Counter Converter February 13, 2014
May 22, 2016 November 30, 2014 In "VHDL"
In "VHDL" In "VHDL" 
Let's Chat? - Online
 VHDL
 shift register fpga implementation, shift register vhdl
 VHDL Testbench Tutorial
 VHDL code for 4-bit ALU


Let's Chat? - Online
6 thoughts on “VHDL Code for 4-Bit Shift
Register”

hemanth
February 6, 2018 at 4:17 pm | Reply

q is a output, u made it as input it leads an error


rite?

Akbar
November 30, 2017 at 6:31 pm | Reply

What does it do exactly?


‘ Q(3 downto 1) <= Q(2 downto 0);'


Let's Chat? - Online
Admin
December 7, 2017 at 12:08 am | Reply

it shift content of the q by 1 bit.

Ms San San Naing


November 27, 2017 at 1:29 am | Reply

Very useful for beginners.


I really apreciate you.

Ms San San Naing


November 27, 2017 at 1:28 am | Reply

Let's Chat? - Online
Thank you so much. Its very useful for vhdl
beginners.
I really apreciate you.

Adam
November 3, 2017 at 5:41 pm | Reply

the example given for PIPO shift register is not


actually a shift register, its a storing element,
you’re just feeding the input to the output, no
bits have been shifted, please revise that!

Leave a Reply


Let's Chat? - Online
Enter your comment here...


Let's Chat? - Online
INTRODUCING

EDGE Spartan6
FPGA
Development
Board
BUY NOW

Let's Chat? - Online
Top Posts & Pages

VHDL Code for Flip op - D,JK,SR,T

VHDL 4 to 1 Mux (Multiplexer)

VHDL Code for Full Adder

BCD to 7 Segment Decoder VHDL Code

VHDL Code for 2 to 4 decoder

VHDL Code for 4-Bit Shift Register

VHDL code for 4-bit ALU

VHDL Code for 4 to 2 Encoder


Let's Chat? - Online
VHDL code for 1 to 4 Demux

4 Bit Ripple Carry Adder VHDL Code

Recent Posts

Introducing EDGE Spartan 6 FPGA Development Board!


BCD to 7 Segment Decoder VHDL Code
Sequence Detector using Mealy and Moore State
Machine VHDL Codes
Carry Select Adder VHDL Code
Carry Save Adder VHDL Code
Carry Look Ahead Adder VHDL Code
4 Bit Ripple Carry Adder VHDL Code
VHDL Code for 4-bit Ring Counter and Johnson Counter
VHDL Code for 2 to 4 decoder
VHDL Code for 4 to 2 Encoder


Let's Chat? - Online
About Us

We are the developers of high quality and low cost


FPGA development kits. Our aim is to provide the best
FPGA learning platform to the students, research
scholars and young engineers. We have created EDGE
Spartan6 FPGA development kit with awesome
features like  WiFi, Bluetooth, Stereo Jack, VGA, LCD, 7
Segment, ADC, DAC, Camera, TFT,and lot more. 
Let's Chat? - Online
Customer service is the experience we deliver to our
customer. It’s the promise we keep to the customer.

Like us on Facebook

All About FPGA


3,339 likes

Like Page Shop Now

Be the first of your friends to like this

  

Newsletter

Subscribe to our newsletter and receive the latest 


offers, discounts and updates
Let's Chat? - Online
Email Address

Subscribe

My Accounts

My account
Checkout
Cart
Shop
Terms of Service
Store A liates
A liate Login

Let's Chat? - Online
© 2018 • All About FPGA


Let's Chat? - Online

You might also like