This circuit finds the gcd (greatest common divisor) of 2 4-bit numbers which are entered by dip switch and it uses the Euclidean algorithm. Result displays by seven segment display. The algorithm has been optimized by designing the control unit and datapath.
Enter 4-bit 1st number by dip switches and set num_okey switch to 1. By doing that 1st number saved in register. Set num_okey switch to 0 and enter 2nd 4-bit number. Set num_okey switch to 0 and after that gcd result will appear in seven segment display.
None
# | Input | Output |
---|---|---|
0 | clock | ssd_out[0] |
1 | number[0] | ssd_out[1] |
2 | number[1] | ssd_out[2] |
3 | number[2] | ssd_out[3] |
4 | number[3] | ssd_out[4] |
5 | ssd_out[5] | |
6 | rst | ssd_out[6] |
7 | num_okey |