Teach Any Computer Science Class
We have put together a full GCSE Computer Science curriculum that will give you all the teaching materials you need to teach any topic.
Whether you're a brand new Computer Science teacher, or you've been teaching ICT for years, our resources will save you hours and hours of lesson preparation every single week.View the Lessons →
A logic circuit is a circuit that executes a processing or controlling function in a computer. This circuit implements logical operations on information to process it.
Logic circuits utilize two values for a physical quantity, like voltage, to denote the Boolean values true and false or 1 and 0 respectively. Logic circuits have inputs and the outputs can be dependent on the inputs. In logic circuit diagrams, connection from one circuit’s output to another circuit’s input is displayed as an arrowhead at the input end.
When it comes to performance, logic circuits are similar to programming language functions. The inputs are similar to function parameters while the outputs are similar to function returned values. A logic circuit can accommodate multiple outputs.
Two Types of Logic Circuitry
- Combinational circuitry – performs like a simple function. The output is based on the present values of the input.
Combinational circuitry is theoretically built from basic logic gates: AND gates, OR gates, XOR gates, and inverters. The outputs of gates in combinational circuitry are never sent back directly to earlier inputs.
- An AND gate can conceptually have any number of inputs. Its output is true when all of its inputs are true.
An AND gate is frequently used to control a signal – turn it on or off depending on the value of control signals.
- An OR gate can conceptually have any number of inputs. Its output is true when any one of its inputs is true.
- An XOR gate has two inputs. Its output is true when one of its inputs, but not both are true.
An XOR gate is sometimes used to control a signal – invert it or not depending on the value of a control signal.
Basic logic gates can be combined to form a variety of higher-level units:
- Multiplexers – have several data input signals and a control input. The output is identical to one of the inputs. The value of the control signal determines which one.
- Demultiplexers – have one data input signal, a control input and several output signals. All of the output signals are 0 (false) except for the one selected by the control input. The selected output is identical to the data input.
- Full adders – perform a single column of a binary addition. They are the primary building block for multi-bit adders and subtracters.
- Adders and Subtracters – add or subtract two binary or two complement numbers. A subtracter is just an adder with extra circuitry to do a two-complement operation on one of the inputs. Usually they are designed to do either addition or subtraction as directed by a control signal.
- Comparators – compare two binary or two complement numbers.
- State circuitry – performs like an object method. The output is not only based on the input. It is also based on the historical inputs. This is made possible due to the memory embedded in the circuitry.
This is similar to an object method with values depending on the object’s state, or its instance variables.State circuitry contains anything that can recollect bits of information including memory, registers and program counter.
The basic element of state circuitry is a flip-flop. A flip-flop stores one bit of data. Multiple flip-flops can be combined to form a multi-bit state element called a register. Multiple registers can be combined into a register bank.
These two types of logic circuitry work hand in hand to form a processor datapath.
A processor’s datapath is conceptually organized into two parts:
- Combinational logic determines the state of the processor for the next clock cycle. The ALU is combinational logic.
- State elements hold information about the state of the processor during the current clock cycle. All registers are state elements.