Logic

= = =Introduction =  Logic is basically is the ability to reason, through inductive reasoning, abductive reasoning, and deductive reasoning. Logic in computers is simply the processing of data inputed by the user and outputing the processed data back to the user. Computers converts the input into electrical signals of 0s and 1s. Computers use an electrical representaion of Logic Gates, which is a representaion of Boolean logic.

Logic Gates and Boolean logic
A computer is able to calculate information sent by the user converting the information into byte, a form of information read by computer. Then the bytes are sent through out the computer turning on or off different logic gates within the circuit board in order to calculate and output the correct response. This type of calculation or logic is called Boolean Logic. Boolean logic is developed by mathematician named George Boole in the mid 1840s. Boole’s branch of mathematical logic is based on the idea of receiving an input and outputting the result into either true or false. Therefore, the results of all calculation are converted into a binary or in other words, ones and zeroes. Based on the idea of Boolean logic, an electric circuit is able to turn on or off logic gates, which is a device built into a circuit that takes one or more inputs and output either a true or false, to output different results depending on the input. A computer is constructed by connecting eletric circuits together so that a different circuit receives and process different information, but together they calculate the user's input and outputs a result. Therefore, in short, the computer is able to display the output the user want by calculating the input though its logic which is based on using electronic signals to turn on or off logic gates located on the circuits.

 figure 1. The output of an AND gate is only 1 if both its inputs are 1. For all other possible inputs the output is 0.  The output of an OR gate is a 1 if one or the other or both of the inputs are 1, but a 0 if both inputs are 0.  The NOT gate, also known as the Inverter, outputs the opposite state to its input. With an input 0, the output is 1 and with an input 1 the output is 0.  The output of the NOR gate is a 1 if both inputs are 0 but a 0 if one or the other or both the inputs are 1.  The output of the NAND gate is a 0 if both inputs are 1 but a 1 if one or the other or both the inputs are 0.  The output of the XOR gate is a 1 if either but not both inputs are 1 and a 0 if the inputs are both 0 or both 1.

Appilcation in Java
Java uses a code-compiler, which does not create a machine-code, like normal Windows programs, but a byte-code, which the Java interpreter runs. Similar to a mini-operating system, it forms a layer between the operating system and the program code. This way, Java can run programs on almost any platform. A disadvantage to this method is, that Java is slower than other languages. Java Byte Code is the language that the Java Virtual Machine understands, with each bytecode being one byte in length. Bytecodes are the machine language of the Java Virtual Machine and when a JVM loads a class file, it gets one stream of bytecode for each method in the class. The bytecodes streams are stored in the method area of the JVM. The bytecodes for a method are executed when that method is invoked during the course of running the program.

References
 Null, Linda; Lobur, Julia (2006). //The essentials of computer organization and architecture//. Jones & Bartlett Publishers.p. 121.[|ISBN] [|0763737690] .<[|http://books.google.com.ar/books?id=QGPHAl9GE-IC&printsec=frontcover&dq=The+essentials+of+computer+organization+and+architecture#v=onepage&q&f=false] .>

Ward (2009). Computation Structures. MIT OpenCourseWare. <[]>

<span style="font-family: Arial,Helvetica,sans-serif; font-size: 16px;">Venners, Bill. "Bytecode Basics."//JavaWorld//.JavaWorld, 09 01 96.Web. 27 Apr. 2012. <[]. >

<span style="font-family: Arial,Helvetica,sans-serif;">Hewes, John. "Logic Gates." //The Electronics Club//. The Electronics Club, 2011. Web. 27 Apr 2012. <http://www.kpsec.freeuk.com/gates.htm