1007ICT Introduction to Computer Systems and Networks — Assignment 1 — Designing an 8 Function 4 Bit ALU

Pref­ace

Terms

You are view­ing an assign­ment from my 1007ICT Intro­duc­tion to Com­puter Sys­tems and Net­works course at Grif­fith Uni­ver­sity. This assign­ment is indi­vid­ual, in which intel­lec­tual prop­erty remains that of me, unless oth­er­wise stated via ref­er­enc­ing. Feel free to use or quote any mate­r­ial from this assign­ment, how­ever, you must credit this work as mine, and not rep­re­sent it as yours.

Def­i­n­i­tions

Mine”, “me”, “I” all refer to Edmond den Dekker.
“You”, “yours” refers to any­one that has the abil­ity to view this con­tent in any way.



1. Cir­cuit Function

1.1. Brief

This 8 func­tion 4 bit ALU was cre­ated by com­bin­ing four 1 bit ALUs, each with the fol­low­ing com­po­nents and functionality–
  • XOR
    • X = A XOR B
  • AND
    • X = A AND B
  • OR
    • X = A OR B
  • Full Adder with Sub­trac­tion – Dou­bles as an Adder and Subtractor
    • X = A + B
    • X = A — B
  • 4 Input Mul­ti­plexor – Pro­vides shift­ing left, right and thru capabilities
    • X = A Shifted left by 1 bit
    • X= A Shifted right by 1 bit
    • X = A
The above com­po­nents are located in a Logic Unit as seen in sec­tion 2.8. The Logic Unit is part of the 1 bit ALU. The logic unit’s out­put is selected via an 8 input mul­ti­plexor as shown in sec­tion 2.9. This allows the selec­tion of a par­tic­u­lar func­tion based on 3 bits. The design of the Shifter that is inside the Logic Unit, is more of a pas­sive design as Pin A of the Logic Unit is only cou­pled to Pin T of the 4 input mul­ti­plexor. The brunt of the Shifter func­tion­al­ity lies in the wiring of the 4 ALUs to make a 4 bit ALU as seen in sec­tion 1.2 below. The fol­low­ing sec­tions show the func­tion­al­ity of each com­po­nent of the 8 func­tion 4 bit ALU below.

1.2. 8 Func­tion 4 bit ALU





2. Cir­cuit Components

2.1. Full Adder

2.1.1. Cir­cuit Diagram

Full_Adder.dwm Full_Adder.dwt

2.1.2. Truth Table



2.2. Full Adder with Subtraction

2.2.1. Cir­cuit Diagram

Full_Adder_With_Subtraction.dwm Full_Adder_With_Subtraction.dwt

2.2.2. Truth Table

This cir­cuit utilises the Full Adder com­po­nent shown in sec­tion 2.1.1. When S is turned off (set to 0), this cir­cuit becomes the full adder shown in sec­tion 2.1.1. To avoid dupli­ca­tion, the truth table below will only show val­ues when S is turned on (set to 1).

2.3. 2 to 4 Decoder

2.3.1. Cir­cuit Diagram

Decoder_2_4.dwm Decoder_2_4.dwt

2.3.2. Truth Table

The method­ol­ogy for cre­at­ing a 2 to 4 decoder was derived from http://​www​.cs​.uiuc​.edu/​c​l​a​s​s​/​s​p​0​8​/​c​s​2​3​1​/​l​e​c​t​u​r​e​s​/​0​7​-​D​e​c​o​d​e​r​s​.​ppt , accessed 22/​04/​2008. Although the schematic dia­gram was not shown in that source, I man­aged to imple­ment the func­tion­al­ity of turn­ing on and off this cir­cuit via a pin called EN. This aids in the cre­ation of a 3 to 8 decoder shown in sec­tion 2.4. The below truth table shows val­ues when EN is turned on (set to 1). If EN is turned off, this cir­cuit spits out no out­puts.

2.4. 3 to 8 Decoder

2.4.1. Cir­cuit Diagram

Decoder_3_8.dwm Decoder_3_8.dwt

2.4.2. Truth Table

The method­ol­ogy for cre­at­ing a 2 to 4 decoder was derived from http://​www​.cs​.uiuc​.edu/​c​l​a​s​s​/​s​p​0​8​/​c​s​2​3​1​/​l​e​c​t​u​r​e​s​/​0​7​-​D​e​c​o​d​e​r​s​.​ppt , accessed 22/​04/​2008. By hav­ing a 2 to 4 decoder that can be switched on and off via pin EN, we can cou­ple 2 of these cir­cuits to make a 3 to 8 decoder. Below is the truth table for this cir­cuit.

2.5. 4 Input Selector

2.5.1. Cir­cuit Diagram

Selector_4.dwm Selector_4.dwt

2.5.2. Truth Table

To list all pos­si­ble inputs for the above cir­cuit, a very large table would have to be pro­duced, one with 256 lines. There­fore I have decided to sim­plify the table and pro­vide more mean­ing. The truth table below shows that if A is on and if S1 is on, X will be on too. This pat­tern con­tin­ues for each let­ter input. The alphanu­meric input (the selec­tor), passes the value of its cor­re­spond­ing input to X. eg. To pass the value of C, you must turn on S3, that way X will be what ever C is. If the value of C is 0, and S3 is turned on, the value of C will still be passed to X, in which X will be 0.

2.6. 8 Input Selector

2.6.1. Cir­cuit Diagram

Selector_8.dwm Selector_8.dwt

2.6.2. Truth Table

To list all pos­si­ble inputs for the above cir­cuit, a very large table would have to be pro­duced. There­fore I have decided to sim­plify the table and pro­vide more mean­ing. This cir­cuit works exactly like the one in sec­tion 2.5.1. The only dif­fer­ence with this one is that this selec­tor has 8 Inputs. Like the one in sec­tion 2.5.1, the truth table below shows that the Selec­tor (S1– S8) allows the value of the inputs (A– H) to be passed to X.

2.7. Mul­ti­plexor (3 to 8 Decoder & 8 Input Selector)

2.7.1. Cir­cuit Diagram

Multiplexor_3_8_Dec_8_Sel.dwm Multiplexor_3_8_Dec_8_Sel.dwt

2.7.2. Truth Table

To list all pos­si­ble inputs for the above cir­cuit, a very large table would have to be pro­duced. There­fore I have decided to sim­plify the table and pro­vide more mean­ing. This Mul­ti­plexor allows us to input a 3 bit binary to use as a selec­tor of 8 pos­si­ble inputs (A – H)

2.8. Logic Unit (Log­i­cal AND/​OR/​XOR, Full Adder with Sub­trac­tion, Shifter)

2.8.1. Cir­cuit Diagram

Logic_Unit_8_Functions.dwm Logic_Unit_8_Functions.dwt

2.8.2. Truth Table

To list all pos­si­ble inputs for the above cir­cuit, a very large table would have to be pro­duced. There­fore I have decided to sim­plify the table and pro­vide more mean­ing. The truth table below was con­structed on the basis that there are five com­po­nents which alto­gether make up 8 func­tions. All five com­po­nents are wired in par­al­lel. The light green sec­tions below show all pos­si­ble inputs and out­puts for each XOR, AND and OR com­po­nent. The cyan sec­tions show all pos­si­ble inputs and out­puts for the Full Adder in Sub­trac­tion mode (Sub set to 1), while the pale blue sec­tions show all pos­si­ble inputs and out­puts for the Full Adder in Addi­tion mode (Sub set 0). The cyan and pale blue sec­tions are a direct reflec­tion of sec­tions 2.1 and 2.2. The pur­ple sec­tions show all pos­si­ble inputs and out­puts for the 4 input mul­ti­plexor. When this com­po­nent is wired into a 4 bit ALU it becomes a func­tional 4 bit shifter as dis­cussed in sec­tions 1.1 and seen in sec­tion 1.2. The 4 input mul­ti­plexor shown 2.8.1 has an EN pin wired to a Vcc-​​, this just mean that power is being sent to that pin (ie. Set EN to 1), result­ing in the 2 to 4 decoder inside it to be turned on.

2.9. 1 Bit ALU (Logic Unit and Multiplexor)

2.9.1. Cir­cuit Diagram

ALU_1bit_8_Function.dwm
ALU_1bit_8_Function.dwt

2.9.2. Truth Table

To list all pos­si­ble inputs for cir­cuit dia­gram 2.9.1, a very large table would have to be pro­duced. There­fore I have decided to sim­plify the table and pro­vide more mean­ing. This cir­cuit utilises the logic unit and passes its value to X via the 8 input mul­ti­plexor. The 8 inputs of the mul­ti­plexor are selected depend­ing on the value of S1 to S3 pins. See sec­tion 2.8.1 for the logic unit’s truth tables. The light green sec­tions below shows all pos­si­ble inputs and out­puts when XOR, AND and OR func­tions are selected. The cyan sec­tions show all pos­si­ble inputs and out­puts for the Full Adder’s addi­tion func­tion. The pale blue sec­tions show all pos­si­ble inputs and out­puts for the Full Adder’s sub­trac­tion func­tion. The pur­ple sec­tions show all pos­si­ble inputs for when X becomes 1 and some pos­si­ble inputs for when X become 0. The pur­ple sec­tion is just a mul­ti­plexor in which it passes the value of A, L or R to X, depend­ing on the value for S1, S2 and S3.
  • Share/Bookmark

Related posts:

  1. 2506ICT Com­puter Com­mu­ni­ca­tion and Net­works — Assign­ment 2 — Proxy Server with Caching and validation
  2. 2655GFS Dig­i­tal Video Pro­duc­tion Assign­ment 1
  3. 2512ICT eCom­merce — Assign­ment 1 — Rev­enue Mod­els, Cus­tomer Cen­tric Design, SWOT, and News Subscriptions

If you found this, or any other article useful, PLEASE SUPPORT MY WORK by clicking on any google ad on this website! Thanks!!

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

When commenting, please wrap all code with [code] [/code]
eg. [code lang="php"] [/code],
[code lang="java"] [/code],
[code lang="javascript"] [/code],
[code lang="html"] [/code],
[code lang="css"] [/code], etc.

WordPress Themes