# 计算机代写｜CSSE2010/7201 – Introduction to Computer Systems Assignment 1: Digital Logic Design

这是一篇来自澳洲的关于数学逻辑设计的**计算机代写**

This assignment involves a design task and a circuit construction (for internal mode)/simulation (for external mode) task as outlined below.

**Design task (Part A):**Provide design details for the problem specification given in Part A. For both internal and external students, submission for this part is a PDF document, either electronically typeset or handwritten and scanned. No simulation or circuit construction is required for this part.

**Circuit Construction/Simulation task (Part B):**Verify the functionality of the given circuit described in Part B via circuit construction (internal mode students) or Logisim simulation (external mode students). Submission for this part include:

**– **Internal mode: A photo of the constructed circuit and a video showing the operation of the circuit.

**– **External mode: Logisim/Logisim evolution file and a screen recording showing the simulation.

Submission is a single .zip file containing the above and more details are given in the submission section of this document.

**Part A – Design Task [12 Marks] **

Consider the 3-input Boolean function *F *= *f*(*A, B, C*) defined based on the last digit of your 8-digit student number as shown in Table 1. Here, *A, B, C *are single bit binary variables.

Table 1: Definition of the given Boolean function *F *= *f*(*A, B, C*) based on the last digit of the 8-digit student number.

Here, “+” indicates arithmetic addition. When listed in a truth table, you should have the input variable *A *as the MSB (left most input column) and *C *the LSB (right most input column). The table only specifies conditions for *F *= 1 and it is implied that *F *= 0 otherwise.

Last digit of 8-digit student number Definition of the function *F *= *f*(*A, B, C*)

0-1 *F *= 1 if *C **≥ *(*A *+ *B*)

2-3 *F *= 1 if (*A *+ *B *+ *C*) *> *0 and the unsigned number *ABC *is exactly divisible by 3 or 5 or 7

4-5 *F *= 1 if (*A *+ *B *+ *C*) *> *0 and the unsigned number *ABC *is exactly divisible by 2 or 7

6-7 *F *= 1 if *C < *(*A *+ *B*)

8-9 *F *= 1 if a majority of inputs are 0

Select the definition for *F *from the table above based on the last digit of your student number and complete the following steps:

- Provide a truth table for the function
*F*=*f*(*A, B, C*) [2 marks]. - Provide (un-simplified) sum-of-product (SOP) Boolean expression for
*F*[2 marks]. - Provide a simplified SOP expression for
*F*containing only two variables in each product term [2 marks]. - Provide a logic diagram for
*F*based on the simplified SOP expression in step 3 using AND/OR/NOT gates [2 marks].

- Provide a circuit schematic diagram for a 2-input NAND only implementation of
*F*[2 marks]. - Using a logic diagram, show how
*F*can be implemented**only using a 4:1 multiplexer and NOT****gates**[2 marks].

**Part B – Circuit Construction/Simulation Task [8 Marks] **

This task requires you to verify the functionality of a given digital circuit by constructing and testing the circuit on a breadboard (for internal mode students) or by simulating in Logisim (for external mode students).

The circuit to be tested is called a “4-bit binary counter with configurable output detection,” as shown in Fig. 1 and explained below. The circuit contains a 4-bit binary counter (shown in Fig. 2) which outputs a count value 0 *≤ **CNT **≤ *15 when clock pulses are provided by a push button. When the count value reaches a particular number *X*, an output LED is to be turned ON, where the number *X *is provided by the user using 4 switches.

i.e. when *CNT *= *X *an LED should be turned ON and the value 0 *≤ **X **≤ *15 is user-configurable via switches.

The given circuit in Fig. 1 achieves this functionality by taking the 4-bit counter output *CNT **≡ **Q*3*Q*2*Q*1*Q*0,performing the subtraction (*X **− **CNT*) using a 4-bit adder and detecting whether the result of (*X **− **CNT*) is zero using some combinational logic. Note that, the circuit performs (*X**−**CNT*) rather than (*CNT **−**X*) because it is easier to obtain the two’s complement of *CNT *for subtraction by using the *Q *values directly available from flip-flops. That is, the 4-bit adder performs the operation (*X **− **CNT*) = (*X *+ (*−**CNT*)) = (*X *+ *CNT *+ 1),where (*CNT *+ 1) is the two’s complement of *CNT*. Therefore, the adder takes *Q *outputs from the counter and sets the carry-in at LSB to 1, thus performing (*X *+ *CNT *+ 1).

The main circuit is shown in Fig. 1 and the 4-bit counter is also shown in Fig. 2. Note that the 4-bit counter used in this problem is known as an “asynchronous counter” because the four flip-flops do not share a common clock. The main operational clock signal (i.e. the clock signal for flip-flop 0) is provided by the user using push button presses. The counter counts up when the user presses the push button.

Your task is to verify the operation of this circuit shown in Fig. 1.

- Internal mode students: Construct the circuit on breadboard using the logic chips and IO board and verify the correct operation. Submission includes a photo of your constructed circuit and a video showing the functionality.

- External mode students: Create the circuit in Logisim and verify the correct operation via simulation.

Submission includes your Logisim/Logisim Evolution file and a screen recording of your simulation.

**Test Cases **

To demonstrate the functionality of the circuit, your video (or the screen recording for external students) **must ****show two test cases **corresponding to when the value of *X *is equal to the last two digits of your student number. If the last two digits of your student number are the same, then the second test case should use the next digit in the student number which is not equal to the last two digits.

Example: If your 8-digit student number is 12345678 you should perform two tests when *X *= 7 (0111 in binary) and *X *= 8 (1000 in binary). You must reset the circuit before each test by turning the I/O board off and on again. Counting is performed by pressing the push button. On the first test for *X *= 7 (second last digit of your student number), you must set the switches to *S*3*S*2*S*1*S*0 = 0111, observe the output LED is OFF, and count up to 7 and show that the output LED turns ON when counter reaches *X *= 7. On the second test, for *X *= 8 (last digit of your student number), you must set the switches to *S*3*S*2*S*1*S*0 = 1000, observe the output LED is OFF, and count up to *X *= 8 and show the LED turning ON, and further count up beyond 15, wrapping back to 0, and count up to *X *= 8 again, showing the LED turning ON again. If your 8-digit student number contains equal last 2 digits such as 12345677, then your two test cases should use *X *= 7 and *X *= 6.

External mode students should use Logisim input switches/buttons and output LEDs accordingly and optionally use a RESET input to flip-flops to reset the counter back to 0000, between the two test cases.

**Steps to Build the Circuit **

To minimise errors in building and testing the circuit, it is highly recommended that you build the circuit progressively as detailed below, and test the circuit behaviour at each stage. Your are only required to submit a final video showing the operation of the circuit as outlined above. However, you may want to record the output of each incremental step below, so that, if your final circuit doesn’t work, you can submit the outputs of progressive steps and receive partial marks for any correct intermediate outputs. If your final circuit is fully working, then there is no need to submit the intermediate recordings. Marks will be awarded based on demonstrated functionality only. Internal mode students will need at least 5 logic ICs to build the complete circuit and additional wire kits can be provided during the lab sessions, if needed.

- Start with the two least significant bits of the 4-bit binary counter. This should be implemented with a 74HCT74 (Dual D-Type Flip-flop), as you will need access to each flip-flop’s clock input. Start with the first flip-flop, connecting the CLK input to a button on the I/O board. Connect Q to the D input, and make sure you connect the CLR and SET inputs appropriately. You should notice the output Q toggle on each button press. Repeat this for the second flip-flop on the same chip, with the CLK input coming from the previous flip-flop’s Q output. Connect the
*Q*outputs of both flip-flops to two LEDs to ensure that this is a 2-bit binary counter. External mode students should use D flip-flops in Logisim. Take a quick recording. [1 mark]