Skip to main content

Prime Detector

  1. Design a combinational circuit block using AND, OR, and NOT gates to check if the 4-bit binary input number is a prime number(a3a_3 a2a_2 a1a_1 a0a_0 )(i.e. one of 2,3,5,7,11,13). The number is to be inputted through the four on-board slide switches (S4-S1) with MSB bit on S4. Output bit represented by Out If the input 4-bit number is:

    • a prime number, turn LED8 ON [Out = 1].
    • not a prime number, turn LED8 OFF [Out = 0].
note

Please make use of Gates.vhdl file i.e. instantiate components defined in Gates.vhdl rather than using dataflow statements

  1. Describe the logic circuit in VHDL and construct a trace-file (code not expected) which tries all 16 input combinations.
  2. Simulate ( RTL and Gate-Level ) the circuit with the generic test-bench and confirm that your circuit functions correctly. The format for tracefile should be: a3 a2 a1 a0 < space > Out < space > mask−bits
  3. Map your logic circuit to the Krypton board.
  4. Confirm that the post-synthesis gate level netlist functions correctly.
  5. Program the Krypton board and make sure that your implementation works correctly.
  6. Verify you design on Krypton using scanchain