- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
library IEEE;use IEEE.std_logic_1164.all; use IEEE.numeric_std.all;entity shift_reg is port( d : in std_logic; clk : in std_logic; rst_bar : in std_logic; q : out std_logic_vector(7 downto 0) );end shift_reg;architecture post_vhdl_08 of shift_reg is begin process(clk, rst_bar) variable q_int : std_logic_vector(7 downto 0); begin if rst_bar = '0' then q_int := (others => '0'); elsif rising_edge(clk) then q_int := q_int(6 downto 0) & d; end if; q <= q_int; end process;end post_vhdl_08;
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You dont. the sll function always shifts '0's into the right hand bit.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page