DOC PREVIEW
PEPPERDINE COSC 425 - Lab 6 Arithmetic Logic Unit

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Computer Systems Lab 6– 1 – Arithmetic Logic Unit Object To investigate the properties of an arithmetic logic unit (ALU) and to use it to evaluate simple arithmetic expressions. Parts (1) 7404 Hex Inverter(2) 7476 Dual J-K Flip-flop(1) 74181 ALU/Function Generator Study sections Computer Systems , Fourth Edition, Jones and Bartlett Publishers: Section 10.4, Combinational Devices; Section 12.1,Constructing a Level-ISA3 Machine. General information An arithmetic logic unit (ALU) is a basic unit in computers. As the name implies, it performs various arithmetic andlogical operations on the inputs (operands). The operation performed depends upon how the function select lines areset.The five function select inputs of the 74181 ALU consist of one mode control (M), and four select inputs (S3, S2, S1,S0). When M = 1, logic functions are realized. When M = 0, arithmetic functions are realized. The arithmetic func-tions also use the carry-in.The listing of available functions and the encoding is in the parts list. You will use the table for ACTIVE HIGHDATA. High voltage represents 1, and low voltage represents 0. Notice that with this table the carry in Cin (denotedCn in the spec sheet) and carry out Cout (denoted Cn+4) in the spec sheet) are asserted low. That is, Cin = 1 means nocarry, while Cin = 0 means a carry has occurred. In the table "+" means logical OR, and "PLUS" means addition.Note that some logical operations are possible when the arithmetic functions are realized. Procedure 1. Logic FunctionsCalculate the 16 values of F for A = 1010 and B = 1001 by referring to the table in the specification sheet for the74181 ALU assuming the mode input M is high. Enter them into the “F Predicted” column of the table in Figure 1.Construct the circuit shown in Figure 2. Connect M = 1 and Cin = 1. Select the functions with the switches and enterthe values of F in the column labeled “F Observed” by reading the logic indicator LEDs.How does the Observed column compare with the Predicted column? ___________________Computer Systems Lab 6– 2 –A = 1010, B = 1001, M = 1S3 S2 S1 S0SW1 SW2 SW3 SW4 FunctionF PredictedF3 F2 F1 F0LE LF LG LHF ObservedF3 F2 F1 F0LE LF LG LH0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 01 0 1 11 1 0 01 1 0 11 1 1 01 1 1 1Figure 1Instructor verification: ____________________________________________________Computer Systems Lab 6– 3 – 2. Arithmetic functionsConnect M = 0, and maintain Cin = +5V (no carry). Calculate the 16 values of F for A = 1010 and B = 1001 by refer-ring to the table in the specification sheet for the 74181 ALU assuming the mode input M is high. Enter them into the“F Predicted” column of the table in Figure 3.Select the functions with the switches and enter the values of F in the column labeled “F Observed” by reading thelogic indicator LEDs.How does the Observed column compare with the Predicted column? ___________________Figure 2ALU 74181167A319 21 23 18 20 22 1A2A1A0B3B2B1B082S33 4 5S2S1S06F313 11 10F2F1F09LELFLGLH+5VSW1SW2SW3SW4CoutCinMLD+5V+5VGnd+5VGnd+5VGnd+5VGnd+5V Gnd74181 24 12Computer Systems Lab 6– 4 –A = 1010, B = 1001, M = 0, Cin = 1 (no carry)S3 S2 S1 S0SW1 SW2 SW3 SW4 FunctionF PredictedF3 F2 F1 F0LE LF LG LHF ObservedF3 F2 F1 F0LE LF LG LH0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 01 0 1 11 1 0 01 1 0 11 1 1 01 1 1 1Figure 3Computer Systems Lab 6– 5 – 3. Evaluating multiplcationsA series of operations could be performed if we had a register to store the ALU output and then used this data in thenext operation. A register of this type is called an accumulator. Operations are performed on the accumulator and theinput data and stored back in the accumulator.For example, a multiplication could be performed by repeatedly adding the input register to the accumulator. The par-tial sum, however, must not exceed the maximum value representable by the ALU or the accumulator.Construct the circuit shown in Figure 4. Clear the accumulator with switch Y.To multiply enter 3 (0011) in switches SW5 through SW8. Then select the addition function F = A + B by set-ting switches SW1 through SW4 to 1001. The multiply by 4 is now accomplished by clocking with switch X fourtimes (adding 3 + 3 + 3 + 3).Does your circuit give F = 12? __________________The last clock pulse from switch X simply loads the ALU output into the accumulator. The value Cout of the ALUthat corresponds to the displayed value on lights LE LF LG LF is displayed by light LD just before the last clockpulse. The first entry of Figure 5 shows the result.Multiply 4 x 4 using the same procedure and check the value of Cout on the penultimate clock pulse. Record yourresults in the second row of Figure 5.Perform the additional multiplications and list the results in the table of Figure 5.3 4×Computer Systems Lab 6– 6 –Figure 4ALU 74181167A319 21 23 18 20 22 1A2A1A0B3B2B1B082S33 4 5S2S1S06F313 11 10F2F1F09SW1SW2SW3SW4CoutCinMLD+5V+5VGndI 7404 14 7IC1, IC2 7476 5 13ALU 74181 24 12JCPKClear41163215PresetXLE96128711 41163215LG96128711LHIC1 IC1 IC2 IC2LF1I2Y3I4+5V5I6 9I8SW5SW6SW7SW8Computer Systems Lab 6– 7 –ANumber ofswitch Xclock pulsesResult after thelast switch Xclock pulseCout after thepenultimateclock pulse“Carry”or“No Carry”?3 (0011) 4 12 (1100) 1 No carry4 (0100) 44 (0100) 32 (0010) 72 (0010) 8Figure 5Computer Systems Lab 6– 8 – 4. Evaluating arithmetic operationsTo evaluate expressions involving more than one type of operation or different input values, change the switches for Awhile the accumulator retains the partially evaluated expression. For example, to evaluate F = 3 + 2, perform the fol-lowing two steps: In The following table, list the sequence of switch settings you must do to perform . Perform the mul-tiplication by accumulating 3 four times. Verify the sequence with your circuit.AALU functionS3 S2 S1 S0SW1 SW2 SW3 SW4 DescriptionResultLE LF LG LH3 (0011) 0 0 0 0 Sets F to 3 0 0 1 12 (0010) 1 0 0 1 Accumulates F = 3 + 2 0 1 0 1AALU functionS3 S2 S1 S0SW1 SW2 SW3 SW4 DescriptionResultLE LF LG LHF 4 3 2+×=Computer Systems Lab 6– 9 – In the following table, list the sequence of switch settings you must do to perform . You must performthe addition first, then negate. Hint: Consider the 0110 function of the ALU to do your negation in one step. Verify thesequence with your circuit.Instructor verification ______________________________AALU functionS3


View Full Document

PEPPERDINE COSC 425 - Lab 6 Arithmetic Logic Unit

Download Lab 6 Arithmetic Logic Unit
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab 6 Arithmetic Logic Unit and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab 6 Arithmetic Logic Unit 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?