fpga

FPGAs are fun. Especially, when it’s not your everyday job and it’s just a hobby. From the few things that I’ve seen is easy to make simple projects, is nice to know how they work and how you program them and it can be an agonising pain if it’s your job. There are so many things that can go wrong in there, that sometimes is miracle that a project works. Time constrains, parallelisation and several other things in the silicon that are sensitive in so many parameters. It’s hell.
dimtass | www.stupid-projects.com


fpga sources

1
2
3
reg [2:0] SyncA_clkB;
always @(posedge clkB) SyncA_clkB <= {SyncA_clkB[1:0], FlagToggle_clkA};
wire [7:0] my_bus;
1
2
3
4
5
6
7
8
9
10
entity ring_counter is
port ( 
        DAT_O : out unsigned(3 downto 0);
        RST_I : in std_logic;
        CLK_I : in std_logic
        );
end ring_counter;
 
architecture Behavioral of ring_counter is
signal temp : unsigned(3 downto 0):=(others => '0');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module LFSR8_11D(
  input clk,
  output reg [7:0] LFSR = 255
);
wire feedback = LFSR[7] ^ (LFSR[6:0]==7'b0000000);
always @(posedge clk)
begin
  LFSR[0] <= feedback;
  LFSR[1] <= LFSR[0];
  LFSR[2] <= LFSR[1] ^ feedback;
  LFSR[3] <= LFSR[2] ^ feedback;
  LFSR[4] <= LFSR[3] ^ feedback;
  LFSR[5] <= LFSR[4];
  LFSR[6] <= LFSR[5];
  LFSR[7] <= LFSR[6];
end
endmodule