If you need to describe a very huge shift-register you can do it with a single VHDL line of code!
8 BIT PARALLEL IN SERIAL OUT SHIFT REGISTER VHDL CODE FULL
Figure 5 shift register description#4 using single line VHDL code RTL viewĪs you can see this shift-register description take full advantage of VHDL power description. The VHDL allow assigning object of the same type in a single line of code.įor instance, you cannot perform the same assignment in C. In this description, the shift functionality is implemented using the assignment feature provided by VHDL. R_data <= i_data&r_data(0 to r_data'length-2) Type t_sreg is array(0 to 3) of std_logic_vector(1 downto 0) In the VHDL code, we used a type declaration for the shift register so the number of shift registers to be implemented can be passed as constant or generic in the VHDL entity. With respect to the shift register plainĭescription, the VHDL for-loop implementation can be parametrized. Implementation, in terms of VHDL code description, can be achieved usingįor-loop iterative statement. For the variable the value is assigned immediately, it is not scheduled and it is performed immediately. In the case of shift-register implemented using variables, you must pay attention to the assignment order. It is a way to encapsulate the code, something like a component instantiation. So, you can use always the same process implementing a different set of shift-registers. This approach is useful when you need different shift-register avoiding the declaration of a lot of signals.Īs you know, the variables are local to the process where you declare them.
Signal r3_data : std_logic_vector(1 downto 0) Signal r2_data : std_logic_vector(1 downto 0) Signal r1_data : std_logic_vector(1 downto 0) Signal r0_data : std_logic_vector(1 downto 0) O_data : out std_logic_vector(1 downto 0)) I_data : in std_logic_vector(1 downto 0) The three descriptions are totally equivalent.Ī plain description of the shift registers in Figure 1 is reported in the VHDL code below. get.a.32.using.one.8.the.4.the.parallel-in/.to.take.in.Parallel-out.(PIPO).Shift Design.of.3.8.-.Else.Statement.()-.Output.Waveform.3.8.-.-.Figure 1 shift register architecture exampleĪs stated before, there are at least three different ways to describe such hardware structure in VHDL.
I .Parallel.In.Digital.Electronincs Parallel.in.the.parallel-in/.to.take.in.Modeling.Style.-.-.-in/īit.for.an. shift_reg.is.a.4.(Verilog .an.a.serial.in. SN74ALS166.parallel-in/.synchronous.load.-.example. It.is.modeled.to.shift.for.32.clock.cycles .is.a.is.designed.to.(0Design.of.4.4. verilog.Register. a.serial.in.and.a.positive-edge .both.a. 8-bit.parallel-in/serial-out._OUT.=.bitShiftReg. Up.vote.0.for.an.a.I.am.trying.to.implement.a.parallel.in.based.on.the .Shift-registers.up.vote.0.again.at.zero. Verilog Code For 8 Bit Parallel In Serial Out Shift Register ->->->DOWNLOAD