74ls series digital logic tester

8
(/) let's make Explore (/tag/typeid/) Create (/about/submit.jsp) Contests (/contest/) Community (/community/) share what you make > (/editInstructable/) *Update* Featured on www.freetronics.com (http://www.freetronics.com/blogs/news/11619617builda74lsseries digitallogictesterwitharduino#.UtgAf9JDumE (http://www.freetronics.com/blogs/news/11619617builda74lsseries digitallogictesterwitharduino#.UtgAf9JDumE))! In the following instructable, I will demonstrate how to design a circuit and write a test program, using the Arduino Nano, that will test two input Transistor Transistor Logic (TTL) gates including AND, OR, NAND, and XOR. The circuit/program designed will implement a basic two input “truth table” applying ALL possible inputs to the gate(s) while reading back the results to the Arduino Serial Monitor and the LEDs. This very simple circuit and code will demonstrate one of the basic building blocks of Digital Logic. I will try to make this instructable as easy to follow as possible, and if you still have some troubles, please feel free to get in contact with me. Continue onto the next step for the hardware and software requirements. (http://cdn.instructables.com/FE0/S1CD/HQGHLI6J/FE0S1CDHQGHLI6J.LARGE.jpg) About This Instructable License: 3,972 views 21 favorites (/member/Zoran1389/) Zoran1389 (/member/Zoran1389/) Follow I am an electrical engineering and physics student and I love to tinker with things. 17 Bio: (/) 74LS Series Digital Logic Tester by Zoran1389 (/member/Zoran1389/) Collection I Made it! Download (/id/74LSSeriesDigitalLogicTester/?download=pdf) 4 Steps Favorite Share (/id/74LSSeriesDigitalLogicTester/) Login (/account/login) | Sign Up (/account/gopro?sourcea=header&sourceaUrl=/id/74LSSeriesDigitalLogicTester/?ALLSTEPS)

Upload: faizul-ikhsan

Post on 21-Dec-2015

74 views

Category:

Documents


5 download

DESCRIPTION

ic

TRANSCRIPT

Page 1: 74LS Series Digital Logic Tester

(/)

let's makeExplore (/tag/type­id/) Create (/about/submit.jsp) Contests (/contest/) Community (/community/)

share what you make >

(/editInstructable/)

*Update* Featured on www.freetronics.com(http://www.freetronics.com/blogs/news/11619617­build­a­74ls­series­digital­logic­tester­with­arduino#.UtgAf9JDumE(http://www.freetronics.com/blogs/news/11619617­build­a­74ls­series­digital­logic­tester­with­arduino#.UtgAf9JDumE))!

In the following instructable, I will demonstrate how to design a circuit and writea test program, using the Arduino Nano, that will test two input Transistor­Transistor Logic (TTL) gates including AND, OR, NAND, and XOR. Thecircuit/program designed will implement a basic two input “truth table” applyingALL possible inputs to the gate(s) while reading back the results to the ArduinoSerial Monitor and the LEDs. This very simple circuit and code will demonstrateone of the basic building blocks of Digital Logic. I will try to make thisinstructable as easy to follow as possible, and if you still have some troubles,please feel free to get in contact with me. Continue onto the next step for thehardware and software requirements.

(http://cdn.instructables.com/FE0/S1CD/HQGHLI6J/FE0S1CDHQGHLI6J.LARGE.jpg)

About This Instructable

License:3,972 views

21 favorites

(/member/Zoran1389/)

Zoran1389(/member/Zoran1389/)

Follow

I am an electrical engineering andphysics student and I love to tinker withthings.

17

Bio:

(/)

74LS Series Digital Logic Tester by Zoran1389 (/member/Zoran1389/)

Collection I Made it!

Download (/id/74LS­Series­Digital­Logic­Tester/?download=pdf) 4 Steps

Favorite Share

(/id/74LS­Series­Digital­Logic­Tester/)

Login (/account/login) | Sign Up (/account/gopro?sourcea=header&sourceaUrl=/id/74LS­Series­Digital­Logic­Tester/?ALLSTEPS)

Page 2: 74LS Series Digital Logic Tester

Remove these ads by Signing Up (/account/gopro?sourcea=removeads&nxtPgName=74LS+Series+Digital+Logic+Tester&nxtPg=/id/74LS­Series­Digital­Logic­Tester/?ALLSTEPS)

Step 1: Gather Materials

Being a college student means that I am on a tight budget, thus this project wasperfect for me because of how economic it was. The most expensive part wasthe Arduino, but that can always be easily removed and reprogrammed for useon other projects. The total cost for this project should come out to be $15­20.

Hardware List: • Arduino Nano (any 5v Arduino of your choosing will work). • 74LS Series ICs (http://www.futurlec.com/IC74LS00Series.shtml(http://www.futurlec.com/IC74LS00Series.shtml)). • LEDs (http://www.ebay.com/itm/100pcs­3mm­LED­Red­Green­Blue­Yellow­White­Ultra­Bright­Light­Bulbs­Lamp­8000mcd­/300913115328?pt=LH_DefaultDomain_0&hash=item460fd1c0c0(http://www.ebay.com/itm/100pcs­3mm­LED­Red­Green­Blue­Yellow­White­Ultra­Bright­Light­Bulbs­Lamp­8000mcd­/300913115328?pt=LH_DefaultDomain_0&hash=item460fd1c0c0)). • Breadboard (a mini breadboard was perfect in size). • Wire

Software List: • Arduino IDE (my version is 1.0.5).

As you can see the parts list is very minimal. If you have any questionsregarding component compatibility, I'd be more than happy to help. Continueonto the next step for the circuit construction.

Related

See More(http://www.instructables.com/tag/type­id/?

q=&utm_source=base&utm_medium=related­instructables&utm_campaign=related_test)

(http://cdn.instructables.com/F02/TL94/HQGHLMGE/F02TL94HQGHLMGE.LARGE.jpg)

(/id/Obstacle­Avoiding­Robot­1)

(/id/Obstacle­Avoiding­Robot­V2)

More by Zoran1389

arduino (/tag/type­id/category­technology/keyword­

arduino/)

digital (/tag/type­id/category­technology/keyword­

digital/)

logic (/tag/type­id/category­technology/keyword­logic/)

tester (/tag/type­id/category­technology/keyword­

tester/)

nano (/tag/type­id/category­technology/keyword­

nano/)

uno (/tag/type­id/category­technology/keyword­uno/)

IC (/tag/type­id/category­technology/keyword­ic/)

gate (/tag/type­id/category­technology/keyword­gate/)

74LS (/tag/type­id/category­technology/keyword­74ls/)

series (/tag/type­id/category­technology/keyword­

series/)

Tags:

Three tool electronics kit.(http://www.instructables.com/id/Three­tool­electronics­kit/?utm_source=base&utm_medium=related­instructables&utm_campaign=related_test)Build a Coin Counter(http://www.instructables.com/id/Building­a­TTL­Logic­Coin­counter/?utm_source=base&utm_medium=related­Teaching The Laws ofSigns Kit(http://www.instructables.com/id/Teaching­The­Laws­of­Signs­Kit/?utm_source=base&utm_medium=related­CPU Fan Hack ­ RGB LEDs­ Arduino & TLC5940(http://www.instructables.com/id/CPU­Fan­Hack­RGB­LEDs­Arduino­TLC5940/?Binary to BCD CounterUsing TTL's 74LS185(http://www.instructables.com/id/Binary­to­BCD­Counter­Using­TTLs­74LS185/?

Page 3: 74LS Series Digital Logic Tester

Step 2: Building the circuit

As you can see, the circuit is very simple. Make sure you remember the polarityof the LEDs! Also, make sure you understand which pair of bits each LEDrepresents, to help you, I have labeled the inputs to each LED in the schematic.To make the instructable easier to follow, I have also included the two input truthtable for each of the gates, as you can see there.

Now, some of you might be wondering why I left out the NOR gate in thisinstructable. That is because it's I/O is the opposite of the other gates, as you

(http://cdn.instructables.com/FB0/ZU5G/HQGHLMQS/FB0ZU5GHQGHLMQS.LARGE.jpg)

(http://cdn.instructables.com/FJR/MTGP/HQGHLN5X/FJRMTGPHQGHLN5X.LARGE.jpg)

Page 4: 74LS Series Digital Logic Tester

can see in the connection diagrams pictured there. If you have any questionsregarding the circuit, please ask. Continue onto the next step for theprogramming part.

Step 3: Programming

(http://cdn.instructables.com/FWI/J27Y/HQGHLNLJ/FWIJ27YHQGHLNLJ.LARGE.jpg)

(http://cdn.instructables.com/FTI/SFDP/HQGHLOLA/FTISFDPHQGHLOLA.LARGE.jpg)

Page 5: 74LS Series Digital Logic Tester

Throughout the code I set inputs as, (Low, Low), (Low, High), (High, Low), and(High, High) just like a truth table. After we assign these values with High or Lowwe provide an if statement to say if the input is High while under any truth tablevariation then x, our variable, will have a number added to it. The numbers 1, 2,4, and 8 will give us different numbers, as the input is High. The diagram that Ihave pictured there shows directly what I mean. If you have any questionsregarding the code, don't hesitate to ask.

* To show the Arduino Serial Monitor just go to Tools > Serial Monitor in yourArduino IDE, as I have pictured there.

THE CODE:

/* Design a circuit and write a test program, using the Arduino Nano,that will test two input Transistor­Transistor Logic (TTL) gatesincluding AND, OR, NAND, and XOR.By: Zoran M*/int gatevalue; //Declare all of the variablesint inputPin = 4;int Output1Pin = 2;int Output2Pin = 3;int led = 13;int led2 = 12;int led3 = 11;int led4 = 10;int led5 = 9; //Begin declaring what pin is whatvoid setup()Serial.begin(9600);pinMode (Output1Pin, OUTPUT);pinMode (Output2Pin, OUTPUT);pinMode (inputPin, INPUT);pinMode(led, OUTPUT); pinMode(led2, OUTPUT);pinMode(led3, OUTPUT);pinMode(led4, OUTPUT);pinMode(led5, OUTPUT);gatevalue = 0;void loop()gatevalue = gatevalue + (check_Gate(false, false)*8); //When an input is HIGH itwill add a value to the gatevaluegatevalue = gatevalue + (check_Gate(false, true)*4); //and each gate will have adifferent gatevalue.gatevalue = gatevalue + (check_Gate(true, false)*2);gatevalue = gatevalue + (check_Gate(true, true)*1);

switch (gatevalue)case 1: Serial.println("The gate is an AND gate."); //When gatevalue is 1 it is an ANDgate digitalWrite(led, LOW); //if gate is in, light is off digitalWrite(led2, LOW); // AND gate truth table outputs are 0, 0, 0, 1 which ishow the LED’s are set up digitalWrite(led3, LOW); digitalWrite(led4, LOW); digitalWrite(led5, HIGH); break;case 6: Serial.println("The gate is an XOR gate."); digitalWrite(led, LOW); //if gate is in, light is off digitalWrite(led2, LOW);//Truth table values digitalWrite(led3, HIGH); digitalWrite(led4, HIGH);

Page 6: 74LS Series Digital Logic Tester

digitalWrite(led5, LOW); break;case 7: Serial.println("The gate is an OR gate."); digitalWrite(led, LOW); //if gate is in, light is off digitalWrite(led2, LOW); //Truth table values digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, HIGH); break;case 14: Serial.println("The gate is an NAND gate."); digitalWrite(led, LOW); //if gate is in, light is off digitalWrite(led2, HIGH); //Truth table values digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, LOW); break;default: Serial.println("ERROR: Gate Not Present."); digitalWrite(led, HIGH); //if gate is not in, light is on digitalWrite(led2, LOW); digitalWrite(led3, LOW); digitalWrite(led4, LOW); digitalWrite(led5, LOW);gatevalue = 0;delay(1000);int check_Gate(int output1, int output2)int x;digitalWrite(Output1Pin, output1);digitalWrite(Output2Pin, output2);delay(5); // Make sure the signal has time to propogate through the gate.x = digitalRead(inputPin);

return x;

Upload the code to your Arduino, open the Serial Monitor, and monitor theLEDs. Switch out the ICs and test that they all work properly. Make sure that theSerial Monitor and the LEDs are outputting the correct information. Continueonto the next step for additional pictures and the conclusion.

Step 4: Additional pictures and conclusion

Page 7: 74LS Series Digital Logic Tester

Now, if you weren't aware by now, this circuit and code only tests one of the fourgates on the ICs. One addittion/change to this project that could be made is totest all four gates on the chip simultaneously. Indicate results from each gateindependently (fail/pass/type), and if one gate fails the test, or indicates adifferent logic function from the rest, indicate the type of IC by majority vote (i.e.if the tester finds three valid AND gates, but the fourth gate indicates something“OR”, identify the chip as an “AND” gate IC with one bad gate). There are manyvariations and additions that could be made to this project, and I would love tosee some of yours; even if you did it just like I did.

01001000 01100001 01110110 01100101 00100000 01100110 0111010101101110 00100001

(http://cdn.instructables.com/F37/QCOG/HQGHLO2V/F37QCOGHQGHLO2V.LARGE.jpg)

(http://cdn.instructables.com/F51/ZQTA/HQGHLO31/F51ZQTAHQGHLO31.LARGE.jpg)

(http://cdn.instructables.com/F34/DAA9/HQGHLO2Z/F34DAA9HQGHLO2Z.LARGE.jpg)

(http://cdn.instructables.com/FU8/4S0L/HQGHLO36/FU84S0LHQGHLO36.LARGE.jpg)

(http://cdn.instructables.com/F21/QS9L/HQGHLO3B/F21QS9LHQGHLO3B.LARGE.jpg)

(http://cdn.instructables.com/FEC/X7ZD/HQGHLO32/FECX7ZDHQGHLO32.LARGE.jpg)

Show All 7 Items

Page 8: 74LS Series Digital Logic Tester

We have a be nice comment policy. Please be positive and constructive.

I Made it! Add Images Make Comment

About UsWho We Are (/about/)Advertise (/advertise/)Contact (/about/contact.jsp)Jobs (/community/Positions­available­at­Instructables/)Help (/id/how­to­write­a­great­instructable/)

Find UsFacebook (http://www.facebook.com/instructables)

Youtube (http://www.youtube.com/user/instructablestv)

Twitter (http://www.twitter.com/instructables)

Pinterest (http://www.pinterest.com/instructables)

Google+ (https://plus.google.com/+instructables)

Tumblr (http://instructables.tumblr.com)

ResourcesFor Teachers (/teachers/)Artists in Residence (http://www.autodesk.com/artist­in­residence/home)Gift Pro Account (/account/give?sourcea=footer)Forums (/community/)Answers (/tag/type­question/?sort=RECENT)Sitemap (/sitemap/)

Go Pro Today » (/account/gopro?sourcea=footer)

We're Hiring! » (/community/Positions­available­at­Instructables/)

MobileDownload our new apps for iOS,Android and Windows 8!

Android(https://play.google.com/store/apps/details?

id=com.adsk.instructables)

iOS(https://itunes.apple.com/app/instructables/id586765571)

Windows(http://apps.microsoft.com/windows/en­us/app/7afc8194­c771­441a­9590­

54250d6a8300)

Join our newsletter:

Terms of Service (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |Privacy Statement (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |Legal Notices & Trademarks (http://usa.autodesk.com/legal­notices­trademarks/) | Mobile Site (http://m.instructables.com)

(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)

Join!

© 2014 Autodesk, Inc.

Englishenter email