• 沒有找到結果。

dip : in STD_LOGIC_VECTOR (3 downto 0)

N/A
N/A
Protected

Academic year: 2022

Share "dip : in STD_LOGIC_VECTOR (3 downto 0)"

Copied!
2
0
0

加載中.... (立即查看全文)

全文

(1)

--功能功能功能功能::::7777段左移段左移段左移段左移 --利用移位暫存器利用移位暫存器利用移位暫存器利用移位暫存器

-- project name: ch06/ex03 library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity ex03 is

Port ( clk : in STD_LOGIC;

reset : in STD_LOGIC;

position : out STD_LOGIC_VECTOR (3 downto 0);

seg7 : out STD_LOGIC_VECTOR (7 downto 0);

dip : in STD_LOGIC_VECTOR (3 downto 0);

pbsw : in STD_LOGIC);

end ex03;

architecture Behavioral of ex03 is

signal b2seg : STD_LOGIC_VECTOR (7 downto 0);

signal count_t : STD_LOGIC_VECTOR (23 downto 0);

signal clkm : std_logic;

signal shift_reg : STD_LOGIC_VECTOR (3 downto 0); --4bit 移位暫存器移位暫存器移位暫存器 移位暫存器 begin

div:process(clk) begin

if reset = '0' then

count_t <= (others => '0'); --暫停暫停暫停暫停 elsif rising_edge(clk) then

count_t <= count_t + 1;

end if;

clkm <= count_t(23);

end process;

--- move_position:process(clkm)

begin

if reset = '0' then

shift_reg <= "1110";

elsif rising_edge(clkm) then

(2)

shift_reg <= shift_reg(2 downto 0) & shift_reg(3); -- 左移左移左移左移 1bit end if;

end process;

position <= shift_reg;

---

b2seg <= "11000000" when dip ="0000" else --BCD 對對對7對777段解碼段解碼段解碼段解碼 "11111001" when dip ="0001" else

"10100100" when dip ="0010" else "10110000" when dip ="0011" else "10011001" when dip ="0100" else "10010010" when dip ="0101" else

"10000010" when dip ="0110" else "11111000" when dip ="0111" else "10000000" when dip ="1000" else "10010000" when dip ="1001" else

"10001000" when dip ="1010" else "10000011" when dip ="1011" else "11000110" when dip ="1100" else "10100001" when dip ="1101" else

"10000110" when dip ="1110" else "10001110" when dip ="1111" else "11111111";

---

seg7 <= b2seg when pbsw = '0' else "11111111"; --有按下則顯示有按下則顯示有按下則顯示有按下則顯示

end Behavioral;

參考文獻

相關文件

EQUIPAMENTO SOCIAL A CARGO DO INSTITUTO DE ACÇÃO SOCIAL, Nº DE UTENTES E PESSOAL SOCIAL SERVICE FACILITIES OF SOCIAL WELFARE BUREAU, NUMBER OF USERS AND STAFF. 數目 N o

INFORMAÇÃO GLOBAL SOBRE AS ASSOCIAÇÕES DE SOLIDARIEDADE SOCIAL E OS SERVIÇOS SUBSIDIADOS REGULARMENTE PELO INSTITUTO DE ACÇÃO SOCIAL. STATISTICS ON SOCIAL SOLIDARITY ASSOCIATIONS

Valor acrescentado bruto : Receitas do jogo e dos serviços relacionados menos compras de bens e serviços para venda, menos comissões pagas menos despesas de

Manchon: Hypersurfaces in R&#34; and critical points in their external region 1 Bohdan Zeiinka: Domination in generalized Petersen graphs.. 17 Daniel Hort, Jan Chvalina, Jiri

Weak solution for problems with shock &amp; rarefaction waves Interface indicator H I takes value zero away from interfacs, yielding standard compressible Euler equations

(In Section 7.5 we will be able to use Newton's Law of Cooling to find an equation for T as a function of time.) By measuring the slope of the tangent, estimate the rate of change

As  decreases, the graph of  becomes flatter for   0, and eventually the dip rises above the -axis, and then disappears entirely, along with the inflection points.. As 

[r]