Structural 8 Bit Register ExampleSimple Generate Statement
USE gate_lib.resources.all;
GENERIC(tprop : delay := 8 ns;
PORT(d : IN level_vector(7 DOWNTO 0);
q : OUT level_vector(7 DOWNTO 0);
qn : OUT level_vector(7 DOWNTO 0));
ARCHITECTURE structural OF reg8_str IS
FOR ALL : dff USE ENTITY gate_lib.dff(behav);
-- COMPONENT INSTANTIATION (GENERATE)
R1:FOR i IN 1 TO 8 GENERATE
I1:dff GENERIC MAP(tprop => tprop,
PORT MAP(d => d(i-1), clk => clk,
q => q(i-1), qn => qn(i-1));
Notes:
This is a structural description of an 8 bit register using DFFs from the library. A simple generate statement is used to instantiate the DFFs and connect them to the individual “bits” at the register’s input and output. The colors highlight the same parts of the structural description as before.