DesignStudies1 - Design Studies Part 1 4-way Max Finder...

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

View Full Document Right Arrow Icon
Jon Turner/David M. Zar 4-way Max Finder Simple Numeric Display LCD Display Controller Design Studies Part 1
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 2
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
Image of page 3

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

View Full Document Right Arrow Icon
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
Image of page 4
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
Image of page 5

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

View Full Document Right Arrow Icon
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
Image of page 6
7 Block Diagram for Hex Display counter clk (50 MHz) convert bits 19..18 3 2 1 0 4 8 ssg(7..0) 16
Image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern