THEDOGFATHER89
Newbie level 2
- Joined
- Nov 11, 2013
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 15
Hi guys this is my first post.
In my programme i have to Design a Serial In, Parallel Out, (SIPO) sift register with a Clock and Data input (both single
lines and an 8-bit parallel output Q. Serial data is accepted at the shift register input on a rising
clock edge and is placed in the least significant bit – the other 7 bits of existing data shift to left.
The most significant data bit is discarded once each new bit is accepted.
Im having a bit of trouble with the code to discard the most significant bit. Any help will be greatly appreciated thanks
Here is my code so far
In my programme i have to Design a Serial In, Parallel Out, (SIPO) sift register with a Clock and Data input (both single
lines and an 8-bit parallel output Q. Serial data is accepted at the shift register input on a rising
clock edge and is placed in the least significant bit – the other 7 bits of existing data shift to left.
The most significant data bit is discarded once each new bit is accepted.
Im having a bit of trouble with the code to discard the most significant bit. Any help will be greatly appreciated thanks
Here is my code so far
Code:
----------------------------------------------------------------------------------
--SIMPLE GENERATE AND COMPONENT
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity SIPO is
Generic(N:integer :=8);
port(sin,clk :in STD_LOGIC;
sout : out STD_LOGIC );
end SIPO;
architecture SHIFT of SIPO is
component d_flip_flop is
port(D,clk :in STD_LOGIC;
Q,nQ : out STD_LOGIC);
end component d_flip_flop;
signal Z: std_logic_vector (N downto 0);
begin
z(0)<=sin;
Q1:for I in 0 to N-1 generate
d_flip_flopx:d_flip_flop port map(clk,z(i),z(i+1),open);
end generate;
sout<=z(8);
end SHIFT;
Last edited by a moderator: