Description
CENG232
Logic Design
Lab Assignment 2
1 Introduction
This laboratory aims to get you familiar with some of the most important IC components like multiplexers and decoders. You will draw the circuit using the Logisim tool with the given gates.
2 IC Pool
• 74LS08 (AND)
• 74LS32 (OR)
• 74LS04 (Inverter)
• 74LS02 (NOR)
• 74LS00 (NAND)
• 74LS153 (Multiplexer)
• 74LS86 (XOR)
• 74LS138 (Decoder)
• 74LS241 (3-state Buffer, Controlled Buffer)
3 Lab Work
In this LAB, you will design a calculation unit for a 7-bit computer that is specialized in several operations. This unit receives 7-bit long inputs and generates outputs. Every 7-bit input consists of 2-bit opcode (operation code, which decides the operation type that will be performed), 1-bit selection, 2-bit first number (that involves in calculations), 2-bit second number (that involves in calculations) as shown below.
Input: 011000011 → 01 − 1 − 00 − 11
opcode: 01,selection bit: 1,first number: 00,second number: 11
Since the opcode is 2-bit long, the unit can process 4 different operations. 2 of them are specialized in such a way that based on the selection bit they can execute 2 different operations. Therefore there are 6 operations in total that this unit executes, which are Number Comparison, Bit Selection, Subtraction, Addition, Division by 2 and multiplication by 2. Table below depicts the operations for given opcodes.
Operation Set and Input Parts
Opcode Selection First Number Second Number
2ndbit 1st bit 1 bit 2nd bit 1st bit 2nd bit 1st bit Output
O1 O0 S A1 A0 B1 B0
0 0 x (Don’t care) a1 a0 b1 b0 Comparison
A == B or A > B or
A < B
0 1 x (Don’t care) a1 a0 b1 b0 Bit select Check if
B0th bit of
A is 1
1 0 0 a1 a0 b1 b0 A/2
1 0 1 a1 a0 b1 b0 A ∗ 2
1 1 0 a1 a0 b1 b0 A + B
1 1 1 a1 a0 b1 b0 A − B
a1,a0,b1,b0 ∈{0,1}
Opcode = O1O0, Selection=S, First Number = A = A1A0, Second Number = B = B1B0
3.1 Output
The output of the unit consists of 13 outputs in total. One output shows the result of the Bit Selection operation. Another one indicates whether the subtraction operation results in a negative number or not. And the remaining 8 outputs each of which represents a numerical value between 0 and 7 show the numerical results of summation subtraction, division, and multiplication operations. Number inputs of the unit (A and B) are unsigned 2-bit integers. When the unit issues an operation and yields a result, the output that corresponds to numerical value of the result is activated.
Output names and their functions are as follows:
• Numerical values, represents the output of opcodes (10 and 11):
– L7 : 7, L6 : 6, L5 : 5, L4 : 4, L3 : 3, L2 : 2, L1 : 1, L0 : 0.
• Sign inditactor for the Subtraction operation:
– N: 1, The result is negative
– N: 0, The result is positive
• Comparison operation outputs:
– E (Equal): Active if opcode = 00 and A == B
– G (Greater): Active if opcode = 00 and A > B
– L (Less): Active if opcode = 00 and A < B
– B (Bit Selection): Active if opcode == 01 and B0th bit of A is 1.
Notes: A/2 operation yields an integer value from the division. For instance, when A=5, the unit should activate the LED2 output.
Since A is a 2-bit number, a single bit is sufficient to select one of its bits for the Bit Selection operation. For this purpose, only the B0 bit is used for the selection. If it is set, depending on the value of the A1 bit of A, Bit select (B) output is activated (When A1=1 then B=1, otherwise B=0). If B0 is set to 0 then the A0 bit of A is considered similarly.
Here are some examples, including opcodes.
Opcode Selection A B Output
O1 O0 S A1 A0 B1 B0 N E G L B L7 L6 L5 L4 L3 L2 L1 L0
0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 1 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 1 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0
1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0
1 0 1 1 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0
1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0
1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0
You are supposed to implement this computation unit as your second lab work. You need to use ”input pins” for 7-bit inputs (2-bit opcode, 1-bit selection, 2-bit first number, 2-bit second number) and ”output pins” for the output of the controller from the Toolbar at the top of Logisim. Set their labels correctly using the following names. Please, only set the ”label” property of the ”pin” objects (input and output), do not add a ”label” object onto the Logisim canvas.
4 Labelling Specifications
• You have to use pins for your inputs and outputs. Only set label property of the pin objects, do not add a label object.
• Your input pins should be labeled as O1, O0, S, A1, A0, B1, B0.
• Your output pins should be labeled as N, E, G, L, B, L7, L6, L5, L4, L3, L2, L1, L0 • Label properties are case-sensitive. Note that all labels consist of an uppercase letter followed by a number. Please be very careful on correct naming of labels. • If you need to feed any input with a constant value, you can use a constant gate. This gate is under CENG232 gates. We will only set values for O1, O0, S, A1, A0, B1, B0.
• You will receive grade penalty unless labeling is done properly.
5 Deliverables
• The evaluation of the submission will be a black-box test.
• You should use the CENG version of Logisim which is available on ODTUClass course page. Circuits designed with other Logisim versions, other tools, or that are not named properly will not be graded!
6 Cheating Policy
All the lab work should be individual and there is a zero-tolerance policy for cheating. See the course website for further information about the cheating policy.
7 References
CENG Logisim Version.




Reviews
There are no reviews yet.