代写Lab 2: Higher Order Logic调试SPSS

Lab 2: Higher Order Logic

Due Oct 31th, 2025, 11:59 PM

Minimum Submission Requirements

● Ensure that your lab2 folder in your Gradescope submission contains the following files (note the capitalization convention):

 lab2_part1.dig 

 lab2_part2.dig 

 lab2_part3.dig 

Objective

The objective of this lab is to build a higher order logic structure and introduce an overly simple data path.

Breakdown

This assignment consists of three parts:

Part-1: Adder and Subtractor for 2’s Complement  ->complete lab2_part1.dig

Part-2: Display Decimal from 2's Complement ->complete lab2_part2.dig

Part-3: Data Path using part1 and part2 ->complete lab2_part3.dig

External Resources

Registers, Flip-Flops, and Modular Design This short video provides a very brief introduction to storage elements in digital logic. We will be utilizing their principles in lab2. If, by now, storage elements have not yet been covered in the lecture, this quick video will give you a primer on this subject. After watching this video, please go through this note on registers to ensure you have the working knowledge of storage elements needed for lab 2.

Tests

Each interface file provided contains a Test Component. These are not extensive tests. Rather, these tests are examples you may wish to follow when implementing your own tests. Your tests will not be graded, but we highly encourage you to test your circuits exhaustively to ensure proper functionality.

Specifications: Part-1

Part-1: Description

In this lab part, you will build an Adder Subtractor circuit. This circuit will implement a four bit Add_Sub. This Add_Sub will perform. an operation on 2 inputs of 4 bits each and use 1 input to identify whether the Add_Sub has to perform. addition or subtraction operation.

The Add_Sub you will be implementing consists of two 4-bit inputs (named inA and inB), one 1-bit input (named op), and one 4-bit output (named out), and one 1-bit output (named overflow). Your Add_Sub  must add inA and inB (inA+inB) if op is 0. Additionally, your add_sub must subtract inA and inB (inA-inB) if op is 1.

Part-1: User Interface  

You are provided an interface file lab2_part1.dig; start Part-1 from this file. You are not permitted to edit the content inside the dotted lines rectangle.


Figure: lab2_part1.dig Interface (Example 1)

Part-1: Example 1

In the figure above, the input values that we have selected to test are inA = {inA_3, inA_2, inA_1, inA_0} = {0, 0, 1, 1} and inB = {inB_3, inB_2, inB_1, inB_0} = {0, 1, 0, 0} and p = {1}. Therefore, considering “op” value, we must perform. (inA-inB) operation.

Explanation of output for this example:

 0011 in 2’s complement means decimal 3. 0100 in 2’s complement means decimal 4.

3-4=-1 (in decimal).

 Decimal “-1” in 2’s complement is “1111” without overflow, i.e. ut= “1111”, verflow= “0” (in binary 2’s complement).

This can be seen in the Figure above.

Figure: lab2_part1.dig Interface (Example 2)

Part-1: Example 2

In the figure above, the input values that we have selected to test are inA = {inA_3, inA_2, inA_1, inA_0} = {0, 1, 0,0} and inB = {inB_3, inB_2, inB_1, inB_0} = {0, 1, 0, 0} and p = {0}. Therefore, considering “op” value, we must perform. (inA+inB) operation.

Explanation of output for this example:

 0100 in 2’s complement means decimal 4.

4+4=8 (in decimal).

The range of 4 bit 2’s complement numbers is: {-2^(n-1) to +2^(n-1) -1} i.e. -8 to +7 in our example.

This range does not fit +8 and thus the output overflows. Thus overflow is 1 for this example output.

This can be seen in the Figure above.

When you open the lab2_part1.dig file, you will of course not see these exact values in green because that is what we used to verify your circuit correctly working by clicking on the Simulate button. On your end, you should go through all possible test cases to verify your design works. Make sure to name all the wires and input/outputs correctly so that they match the test interface names within lab2_part1.dig. You will need to do the same for part2 and part 3 as well.

Hint: Using Multiplexers will help you out a lot here.

The “Tunnel” component in Digital for Lab2

In Lab1, you might have noticed how much effort it took to draw so many inputs and wire them all over the place without unintentionally connecting them to the incorrect outputs and nodes! Turns out, Digital does provide some means to help reduce this burden.

This manifests as the Tunnel component. Go to Components->Wires->Tunnel. The symbol looks like a triangle with one vertex being a bleft dot. The idea is that instead of extending your wires physically all over your circuit drawing space by drawing them as lines, you can use tunnels as placeholders in different locations on your diagram for the same wire. These tunnels must have the same name so as to symbolize the same electrical connection.

You are provided the file playWithTunnels.dig to give you an idea of how tunnels work in Digital. Think of them as being like wormholes that can connect 2 physically separate points on your circuit diagram through the same wire connection.

Figure: playWithTunnels.dig screenshot

Note that all the Interface areas in the .dig files for part1, part2 and part3 have tunnel components in them. That means when you draw your circuit outside the interface box in these files, you will need to draw the appropriate number of tunnel wires which hook up (via wormholes!) to the provided inputs and outputs within the interface box. Make sure the tunnels have the correct wire names.

Specifications: Part-2

Part-2: Description

In this part of the lab, we will illuminate two 7-segment displays. You will need to understand 2's Complement to determine when the input 4-bit binary number corresponds to a negative or positive number. To understand how an LED display works in Digital, please refer to the playWithLED_Display.dig file provided. You should play with different input combinations to see how it influences the LED Display value. In the screenshot below, note how I was able to generate the display of “3” on the Hex display by lighting up only certain input wires to the unit.

Figure: playWithLED_Display.dig screenshot

Here is a picture of how the different segments light up to produce the different displays:

Figure: Lighting up different segments to produce display of 0-8

Note in the picture above that we showed displays only from 0-8 since in 4-bit 2s complement representation, 8 is the largest modulus value you can represent (the range of integers would be -8 to +7).

Your circuit in Part-2 must accept a 4-bit 2's complement input {in3, in2, in1, in0} where in3 is the most significant bit and in0 is the least significant bit. The outputs of your circuit must illuminate the two 7-segment displays such that they display the decimal value of the input. Since this a 4-bit 2s complement represented number, that means the range of numbers (24=16) that can be shown correctly on the hex display (with sign) is [-24-1, +24-1-1] = [-8, +7]

Part-2: User Interface

You are provided an interface file lab2_part2.dig, start Part-2 from this file. You are not permitted to edit the content inside the dotted lines rectangle.

Figure: lab2_part2.dig Interface

Part-2: Example

In the figure above, the input is {in3, in2, in1, in0} = {0, 0, 1, 1} Which means the input signal in, as a bus, reads 0011. Which is the 2's complement binary representation of the value +3. Note: only the middle segment, sign_g, (it appears as signg on the Digital screenshot) on the left display will be illuminated, and that too ONLY for negative values. Since +3 is a positive number, it is not illuminated in the above example. All the remaining sign signals remain turned off for both positive and negative numbers.

Specifications: Part-3

Part-3: Description

In this part of the lab, you will create a data path for the Add_Sub you build in Part-1. This data path will consist of 4 registers.

In this lab, we are using the register components. Refer to playwithRegister.dig to get a good starting idea of how this component works.

You will need to address 1 register via the interface select signals to determine which 4-bit register to write the input value to. Then using the D-Flip-flops in Digital.

You will use only one Clock Input to keep the circuit synchronized. That is, with Clock=1, set up your register Clock to 1. For this lab, a manual setting of clock signal from 0 to 1 is needed. Do not create a periodic clock signal.

Part-3: User Interface

You are provided an interface file lab2_part3.dig, start Part-3 from this file. You are not permitted to edit the content inside the dotted lines rectangles.

Figure: lab2_part3.dig Interface

Part-3: Example        bcf

In this design, the user can choose out of the 4 registers where to store the 4-bit value which needs to be from (inA from part-1) and also which register to store the result of the operation (inB from part-1), using the selwrite register selection inputs. The user ensures they direct these two registers to the correct Register Selection: Read From values for inA and inB inputs values to the Add_Sub.

Clock edge is used to load the values in the registers selected. So, When you click on “Synchronizing Clock”, a positive edge of the clock is created. This makes the Register capture the data value.

In the figure above, we have written the value 3 to Register 3 and the value 4 to Register 2 and op is selected as 1 (Just like in part1 example2). Then, we read from Register 3 the value 3 to Add_Sub input A and read from Register 2 the value 4 to Add_Sub input B. Subtracting (op is 1) B from A gives Output as hexadecimal F without overflow.

Part-3: Diagram

The following diagram illustrates the high level design of this part. The black sections are provided, while the blue sections you must implement yourself.

 


 


热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图