Presentation is loading. Please wait.

Presentation is loading. Please wait.

Integer Square Root CSE 670 Exam 1 Robert Hodge March 1, 2004.

Similar presentations


Presentation on theme: "Integer Square Root CSE 670 Exam 1 Robert Hodge March 1, 2004."— Presentation transcript:

1 Integer Square Root CSE 670 Exam 1 Robert Hodge March 1, 2004

2 Square Root Calculator - Features BCD input rather than binary, via SW(1:8) Input up to 9999; two digits at a time Attempt to enter invalid BCD disallowed Invalid digits appear as underscores BTN4 advances state machine LD(1:3) display progress of operation (steps 1, 2, 3) BTN1 switches result display from square root to remainder value LED on main board lights up when BTN4, BTN1 or BN is pressed Result values are zero-suppressed on 7-segment display

3 Square Root – Control and Data Path Sqrt Control Unit Sqrt DataPath: add, subtract, compare >, BCD validate, BCD to binary, 16-bit multiply multiply by 100, shift registers shr_step shr_mask sel_display 2 load_value load_trial load_square load_root load_high valid_bcd square_gt_value mask0 clr clk BTN4BTN1bcd direct (controls display MUX) step result 16 8 8

4 Square Root Algorithm Algorithm and flowchart from Microchip tech bulletin TB040 http://www.microchip.com/download/appnote/library/91040a.pdf

5 State Machine: BCD Input and Validate

6 State Machine: Calculate Root


Download ppt "Integer Square Root CSE 670 Exam 1 Robert Hodge March 1, 2004."

Similar presentations


Ads by Google