DesignStudies1 - Jon Turner/David M. Zar 4-way Max Finder...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Jon Turner/David M. Zar 4-way Max Finder Simple Numeric Display LCD Display Controller Design Studies – Part 1 2 4-Way Max Finder Design Design a circuit with four serial inputs and a serial output equal to the largest input value (values come in msb first); include reset and make output synchronous Break down into three 2-way maximum circuits » note that 2-way max circuit works like comparator, but propagates largest value rather than simply determining which is largest 2-way async max finder Simplified state diagram for 2-way max finder = < > 01/1 10/1 x0/0 x1/1 0x/0 1x/1 00/0 11/1 x y max x y max x y max biggest m_ab m_cd d c a b D > C clk reset a b biggest 0 0 1 1 0 0 1 0 c d 1 1 0 0 1 0 0 1 1 0 1 0 1 1 0 1 0 3 4-Way Max Finder VHDL entity max4 is port ( clk, reset : in std_logic; a,b,c,d : in std_logic; biggest : out std_logic); end max4; architecture arch of max4 is type stateType is (eq, lt, gt); -- states for 2-way comparator function nextState(state:stateType; x,y:std_logic) return stateType is begin if state = eq and x > y then return gt; elsif state = eq and x < y then return lt; else return state; end if; end function nextState; function maxBit(state: stateType; x,y: std_logic) return std_logic is begin if state = gt or (state = eq and x > y) then return x; else return y; end if; end function maxBit; nextState function used to define next states for each of the 2-way max finders maxBit function used to define outputs for each of the 2-way max finders 4 signal s_ab, s_cd, s: stateType; signal m_ab, m_cd, m: std_logic; begin m_ab <= maxBit(s_ab,a,b); m_cd <= maxBit(s_cd,c,d); m <= maxBit(s,m_ab,m_cd); process(clk) begin if rising_edge(clk) then assert m >= a or s_ab = lt or s = lt; assert m >= b or s_ab = gt or s = lt; assert m >= c or s_cd = lt or s = gt; assert m >= d or s_cd = gt or s = gt; if reset = '1' then s_ab <= eq; s_cd <= eq; s <= eq; biggest <= '0'; else s_ab <= nextState(s_ab,a,b); s_cd <= nextState(s_cd,c,d); s <= nextState(s,m_ab,m_cd); biggest <= m; end if; end if; end process; end arch; 2-way max finder outputs are combinational function of current state and input values synchronous updating of state signals overall output assigned synchronously assertions for debugging; violations reported by simulator 5 Simulation Results ab max finder cd max finder overall max finder 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 1 0 0 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 1 0 0 6 Numeric Display Controller Numeric display controlled by two sets of signals » ssg(7..0) control which segments are turned on (0 for on) » an(3..0) control which digits are turned on (0 for on) To give appearance of 4 digit display, cycle rapidly through the four digits (e.g. 10 ms per digit) » so ssg(7..0)=digit 3, an=0111, then ssg(7..0)=digit 2, an=1011, and so forth msb 7 Block Diagram for Hex Display counter clk (50 MHz) convert bits 19..18 3 2 1 0 4 8 ssg(7..0) 16 displayData 4 4 4 4 2...
View Full Document

This document was uploaded on 11/06/2011.

Page1 / 22

DesignStudies1 - Jon Turner/David M. Zar 4-way Max Finder...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online