Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ELEC 2141 Digital Circuit Design

In this assignment you will work on a combination circuit design with a real-world application. It will involve applying all the techniques you have learnt over Weeks 1-4 in the course.

The gate input cost should be calculated for the simplified AND-OR-NOT expressions in the design that you implement. You can choose the technology to implement the circuit with (e.g. AND/OR, NAND, multiplexers, etc.). However, your design for each module should aim at achieving optimized implementation. You must implement your design using structural modelling only in Verilog HDL in Vivado or other online Verilog simulators. Simulate your design using the Vivado simulator (or equivalent simulators) and validate its functionality through appropriate test benches.

Your final submission should include your design procedure, choice of technology implementation, and simulation results (screenshots are adequate for simulation results). Combine all scanned copies of your handwritten work and electronic documents into one pdf file for the submission on Moodle. This includes all design and simulation materials such as schematic diagrams (hand-drawn or electronic), Verilog modules, simulation outputs and testing fixtures.

You will need to separately submit your Verilog code for autotesting. See the final page for file naming convention and required port names. Note that you still need to include screenshots of your code in your report.

You may use online k-map solvers to solve k-maps with more than 4 variables, provided you cite the website.

Any output of generative AI software used within your assignment must be attributed with full referencing. If the outputs of generative AI such as ChatGPT form part of your submission and is not appropriately attributed, it will be regarded as serious academic misconduct and subject to the standard penalties, which may include 00FL, suspension and exclusion.

*To cite: OpenAI (Year Accessed). ChatGPT. OpenAI. https://openai.com/models/chatgpt/

Please note that the outputs from these tools are not always accurate, appropriate, nor properly referenced. You should ensure that you have moderated and critically evaluated the outputs from generative AI tools such as ChatGPT before submission.

JOEXAPE’s Escape Room – Zoo Escape
Figure 1: Escape room gadgets you will need to design
Context

JOEXAPE is a startup based on escape rooms designs. However, the escape room market is becoming increasingly competitive. To keep up with the escape room market, JOEXAPE hired you to design the locks on the escape room doors. JOEXAPE’s upcoming escape room project has the following theme.

You and your crew have time travelled to Utopian 3026. However, the accent of humans has significantly changed, and humans no longer look the same as humans in 2026. Upon arrival, you and your crew are perceived as a newly discovered species due to differences in accent and appearance and are locked up in a futuristic animal zoo.

The Escape Challenge:

In a 3-room stage, each stage requires the team to look for clues to obtain a password used to unlock a safety lock.

However, the difficulty of the room increases to ensure no animal escapes.

• Room 1: clues are numbers – animals probably can’t read.
• Room 2: clues are morse code – some staff might accidentally release monkeys clever enough to escape.
• Room 3: password must be entered in morse code – not a single organism in the zoo is permitted to escape.

If the password is incorrect, the lock will produce a mild zap, discouraging the animals from interacting with the lock.ELEC2141 – Term 1 2026 – Assignment 1

Figure 2: Escape room diagram – Zoo

You are tasked to design an electronic lock where the password and mode can be set by the operator, used in each stage of the escape room. You are also tasked to design a morse code to number decipherer which escape teams will find and use to decipher morse code in the escape event. Finally, you are tasked to design a morse code lock which combines the first two tasks.

Design Tasks
Task 1: Design a 4-digit comparator lock
The lock should compare a four (16-bit) USR password. When ENTER is held down, the lock should either UNLOCK or ZAP -digit (16-bit) SYS password to the user-entered four-digit the user.
Depending on whether the ORD pin is 1 or 0, the unlock condition should change. When ORD = 1, order matters, i.e. USRx = SYSx. When ORD = 0, the unlock condition is valid for any order of input.
For example, if the system password is 0418, then the entered password 8104 is valid if ORD = 0, but invalid if ORD = 1.
You can assume each number can only exist once in the password when ORD = 0. You can further assume that the USRx and SYSx inputs are always valid BCD numbers.
Pin
Type
Description
USR1[3:0],
USR2[3:0],
USR3[3:0],
USR4[3:0]

Input
4 BCD input digits for escape teams to enter their passwords. USRx[3] contains the MSB.
SYS1[3:0],
SYS2[3:0],
SYS3[3:0],
SYS4[3:0]

Input
4 BCD input digits for the operator to set the password. SYSx[3] contains the MSB.
ENTER
Input
A button that determines whether it should unlock or zap the person interacting with the lock
ORD
Input
If ORD = 1, unlock condition should consider order of the digit. Otherwise, order should not be considered
ZAP
Output
Changing this signal to 1 will zap the user. This pin should turn 1 when ENTER is held 1 and unlock conditions are not met.
UNLOCK
Output
Changing this signal to 1 will unlock the lock. This pin should turn 1 when ENTER is held 1 and unlock conditions are met.
Task 2: Design a Morse Code Decipherer
Design a circuit that converts a 5-bit morse code into a 4-bit BCD number
Pin
Type
Description
MORSE[4:0]
Input
5-bit morse code input. 1 indicating a dash and 0 indicating a dot. MORSE[4] indicates the left most bit.
BCD[3:0]
Output
Seven segment display output. BCD[3] contains MSB.
ERROR
Output
High when the morse code signal is invalid (a value othethan those listed below).
Below illustrates the Number to Morse code mapping.
#
code
1 . _ _ _ _
2 . . _ _ _
3 . . . _ _
4 . . . . _
5 . . . . .


#
code
6 _ . . . .
7 _ _ . . .
8 _ _ _ . .
9 _ _ _ _ .
0 _ _ _ _ _

Other morse conditions are invalid and can be treated as don’t care conditions.

Task 3: Design a Morse Code Lock

Using task 1 and 2, design a multi-level morse code lock system where the user inputs 20 morse inputs instead of numbers.

MRSIN[19:15] is the most-significant-code and should be matched with SYS4 if ORD = 1.

This continues down to MRSIN[4:0] which is matched to SYS1 if ORD = 1.

Pin
Type
Description
MRSIN[19:0]
Input
20 bit morse code input
SYS1[3:0],
SYS2[3:0],
SYS3[3:0],
SYS4[3:0]
Input
4 BCD input digits for the operator to set the password. SYSx[3] contains the MSB.
ENTER
Input
A button that determines whether it should unlock or zap the person interacting with the lock
ORD
Input
If ORD = 1, unlock condition should consider order of the digit. Otherwise, order should not be considered
ZAP
Output
Changing this signal to 1 will zap the user. This pin should turn 1 when ENTER is held 1 and unlock conditions are not met. This includes when the morse code input is invalid as described in Task 2.
UNLOCK
Output
Changing this signal to 1 will unlock the lock. This pin should turn 1 when ENTER is held 1 and unlock conditions are met.
Submission
As mentioned earlier, in addition to the report you must also submit all your Verilog modules (not testbenches) as separate files. As we will be running an autotest script on your modules you will need to use the following structure:

You must have three modules named task1, task2 and task3 respectively. You may submit more modules that you use within these modules if you desire, up to a maximum of 10 files.

The task1, task2 and task3 files must have the following port names (if these do not exactly match then your design will fail the autotests):

  • • task1:
    • Inputs: USR1[3:0], USR2[3:0], USR3[3:0], USR4[3:0], SYS1[3:0], SYS2[3:0], SYS3[3:0], SYS4[3:0], ENTER, ORD
    • Outputs: ZAP, UNLOCK
  • • task2:
    • Inputs: MORSE[4:0]
    • Outputs: BCD[3:0], ERROR
  • • task3:
    • Inputs: MRSIN[19:0], SYS1[3:0], SYS2[3:0], SYS3[3:0], SYS4[3:0], ENTER, ORD
    • Outputs: ZAP, UNLOCK
The filenames can be whatever you like, as long as there are modules named task1, task2 and task3. Do not submit a zip of your files.

You must submit the code for all modules (i.e., all .v files) used in your design. Do not submit testbenches.

You can perform a sanity test of your code here: https://forms.gle/Jud5d5efQE9gRXBz8

Tips:

• Within your task3 file, you may instantiate a module named “lock” for the lock, and a module named “decipherer” for the Morse decipherer.

• Consider instantiating modules when writing Verilog.

• There is more than one way to approach the question. It is up to you to justify your design choices. But make sure you are up to date with lecture content so you don’t go down a rabbit hole.