Results 1 to 2 of 2
Thread: Logical Gates
- 08-17-2009, 12:25 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 1
- Rep Power
- 0
Logical Gates
Hi, I'm struggling with the topic of logical gates so I hope someone can help me out.
I'm having trouble with the following:
- boolean expressions, De Morgan Law and expressing terms in NOR/NAND only.
- designing circuits
- implementing circuits with given inputs/outputs (4 bit adder?)
An example of the question I'm struggling on would be:
'Write boolean expressions and design a ciruit with three inputs and one output such that the output is 1 if and only if two or more inpurs are 1.'
Help appreciated, I'm finding this topic so confusing.
- 08-17-2009, 01:11 AM #2
little sample:
the int version would be:Java Code:public static boolean andGate(boolean in1, boolean in2){ if(in1 && in2) return true; return false; } public static boolean orGate(boolean in1, boolean in2){ if(in1 || in2) return true; return false; }
Now you would do something similar for NOR/NAND using three inputs.Java Code:public static int andGate(int in1, int in2){ if(in1==1 && in2==1) return 1; return 0; } public static int orGate(int in1, int in2){ if(in1==1 || in2==1) return 1; return 0; }
check out wikipedia for the truth table, it'll help you out.USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
Similar Threads
-
What is the difference between Semantic Errors and Logical Errors?
By tlau3128 in forum New To JavaReplies: 3Last Post: 03-08-2009, 01:51 AM -
Java + OOP + Logic Gates = HELP!
By sev51 in forum New To JavaReplies: 3Last Post: 01-26-2009, 08:42 PM -
Logical JDBC problem
By nick2price in forum Advanced JavaReplies: 3Last Post: 10-02-2008, 11:34 PM -
Listing Logical Drives
By Juggler in forum New To JavaReplies: 3Last Post: 08-10-2008, 07:08 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks