bciaren
Newbie level 4
- Joined
- Mar 14, 2013
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,336
Need help generating a preamble using VHDL . .
Hello everyone! Could someone help me pick out the flaws in my design? I'm trying to create a preamble using shift registers, but I'm having trouble putting it together..
Here's a picture of the shift registers I'm trying to emulate. .. .
Only rather then the 3 registers, I have 8 to make a byte.
I'm using an XOR gate as an input.
I'm a noobie as you can see, and any assistance is appreciated
Hello everyone! Could someone help me pick out the flaws in my design? I'm trying to create a preamble using shift registers, but I'm having trouble putting it together..
Here's a picture of the shift registers I'm trying to emulate. .. .
Only rather then the 3 registers, I have 8 to make a byte.
I'm using an XOR gate as an input.
Code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity SFD is
port(clk :in std_ulogic;
resetb :in std_ulogic;
decode_SFD_out :out std_ulogic);
end SFD;
architecture preamble of SFD is
signal shiftreg_8 :std_ulogic_vector(7 downto 0);
signal F :std_ulogic;
signal A :std_ulogic;
signal B :std_ulogic;
begin
process(shiftreg_8, resetb) is
begin
if (resetb = '1') then
shiftreg_8 <=(others => '0');
elsif rising_edge(clk) then
shiftreg_8(0) <= F;
shiftreg_8(1) <= shiftreg_8(0) then A <= shiftreg_8(1);
shiftreg_8(2) <= shiftreg_8(1);
shiftreg_8(3) <= shiftreg_8(2);
shiftreg_8(4) <= shiftreg_8(3);
shiftreg_8(5) <= shiftreg_8(4);
shiftreg_8(6) <= shiftreg_8(5);
shiftreg_8(7) <= shiftreg_8(6) then B <= shiftreg)8(7);
end if;
end process;
Process(shiftreg_8)
begin
if(shiftreg_8 ="10101011") then
decode_SFD_out <='1'
else
decode_SFD_out <= '0';
end if;
end process;
F := A XOR B;
end preamble;
Last edited: