Arbitrary Waveform Discussion 5.5 Example 34
Recall Divide-by-8 Counter s0 0 0 0 0 0 1 s1 0 0 1 0 1 0 s2 0 1 0 0 1 1 s3 0 1 1 1 0 0 s4 1 0 0 1 0 1 s5 1 0 1 1 1 0 s6 1 1 0 1 1 1 s7 1 1 1 0 0 0 State q2 q1 q0 D2 D1 D0 Present state Next state Use q2, q1, q0 as inputs to a combinational circuit to produce an arbitrary waveform.
Example State q2 q1 q0 D2 D1 D0 y q2 q1 q0 00 01 11 10 1 s0 0 0 0 0 0 1 1 s1 0 0 1 0 1 0 1 s2 0 1 0 0 1 1 0 s3 0 1 1 1 0 0 0 s4 1 0 0 1 0 1 0 s5 1 0 1 1 1 0 1 s6 1 1 0 1 1 1 0 s7 1 1 1 0 0 0 1 y = ~q2 & ~q1 | q2 & q0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1
International Morse Code
Generating a Morse code A using a 3-bit divide-by-8 counter
K-map for finding A
-- Example 34: Morse code for A library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_unsigned.all; entity morsea is port( clr : in STD_LOGIC; clk : in STD_LOGIC; a : out STD_LOGIC ); end morsea; architecture morsea of morsea is signal q: STD_LOGIC_VECTOR(2 downto 0); begin -- 3-bit counter process(clk, clr) if clr = '1' then q <= "000"; elsif clk'event and clk = '1' then q <= q + 1; end if; end process; a <= (not q(1) and q(0)) or (q(2) and not q(0));
Aldec Active-HDL Simulation