Update
This commit is contained in:
parent
96776982b7
commit
9cb436ae49
3 changed files with 29 additions and 12 deletions
|
@ -1,15 +1,27 @@
|
|||
# Logic Circuit
|
||||
|
||||
Logic circuits are circuits made of [logic gates](logic_gate.md) that implement [Boolean functions](bool.md), i.e. they are "schematics to process 1s and 0s". They are used to design [computers](computer.md) on a low level. Logic circuits are a bit similar to electronic circuits but are a level of [abstraction](abstraction.md) higher: they don't work with continuous [voltages](voltage.md) but rather with [discrete](discrete.md) [binary](binary.md) logic values: 1s and 0s. This allows us to make kind of "[portable](portable.md)" circuit descriptions independent of any specific [transistor](transistor.md) technology, or even of [electronics](electronics.md) itself (as logical circuit may in theory be realized even mechanically or in other similarly wild ways). Logical circuits can be designed and simulated with specialized software and languages such as [VHDL](vhdl.md).
|
||||
Logic circuits are circuits made of [logic gates](logic_gate.md) that implement [Boolean functions](bool.md), i.e. they are "graphical schematics for processing 1s and 0s". They are used to design [computers](computer.md) on quite a low level. Logic circuits are a bit similar to [electronic](electronics.md) circuits but are a level of [abstraction](abstraction.md) higher: they don't work with continuous [voltages](voltage.md) but rather with [discrete](discrete.md) [binary](binary.md) logic values: 1s and 0s. This abstraction makes logic circuits kind of a "[portable](portable.md)" circuit descriptions independent of any specific [transistor](transistor.md) technology, or even of [electronics](electronics.md) itself (as logical circuit may in theory be realized even mechanically, with [fluids](fluidics.md) or in other similarly wild ways). Logical circuits can be designed, simulated and synthesized to actual hardware description with specialized software and languages such as [VHDL](vhdl.md).
|
||||
|
||||
TODO: picture here
|
||||
```
|
||||
0 ___ 1 ___ 1
|
||||
x ------|NOT|-----|AND|------- a
|
||||
|___| .--|___|
|
||||
1 /
|
||||
y -------.---'
|
||||
\ ___ 1 ___ 0
|
||||
0 '--|OR |---|NOT|--- b
|
||||
z ------------|___| |___|
|
||||
|
||||
```
|
||||
|
||||
*Example of a logic circuit with three inputs (x, y, z) and two outputs (a, b), with example input values (0, 1, 0) transformed to output values (1, 0).*
|
||||
|
||||
Generally a logic circuit can be seen as a "black box" that has *N* input bits and *M* output [bits](bit.md). Then we divide logic circuits into two main categories:
|
||||
|
||||
- **combinational**: The output values only depend on the input values, i.e. the circuit implements a pure mathematical [function](function.md). Behavior of such circuit can be described with a [truth table](truth_table.md), i.e. a table that for any combination of input values list their corresponding output. Examples of combinational circuits may be the very basic of logic circuits, the [AND](and.md) and [OR](or.md) functions.
|
||||
- **sequential**: Extension of the former, here the output values generally depend on the input values AND additionally also on the internal [state](state.md) of the circuit, i.e. the circuit has a kind of [memory](memory.md) (it can be seen as a [finite state machine](finite_state_machine.md)). The internal state is normally implemented with so called [flip-flops](flip_flop.md) (logic gates that take as input their own output). Normal truth tables can't be used for describing these circuits (only if we include the internal state in them). These circuits also often work with **[clock](clock.md)** synchronization, i.e. they have a specialized input called *clock* that periodically switches between 1 and 0 which drives the circuit's operation (this is where [overclocking](overclocking.md) comes from).
|
||||
- **sequential**: Extension of the former, here the output values generally depend on the input values AND additionally also on the internal [state](state.md) of the circuit, i.e. the circuit has a kind of [memory](memory.md) (it can be seen as a [finite state machine](finite_state_machine.md)). The internal state is normally implemented with so called [flip-flops](flip_flop.md) (logic gates that take as input their own output). Normal truth tables can't be used for describing these circuits (only if we include the internal state in them). These circuits also often work with **[clock](clock.md)** synchronization, i.e. they have a specialized input called *clock* that periodically switches between 1 and 0 which drives the circuit's operation (this is where clock frequency and [overclocking](overclocking.md) in CPUs comes from).
|
||||
|
||||
Logical circuits can be drawn simply as "boxes", which one the base level are the basic logic gates such as [AND](and.md), [OR](or.md) etc., connected with lines. But as mentioned, their behavior can also be described with a truth table or a boolean expression, i.e. an algebraic expression that for each of the circuit outputs defines how it is computed from the outputs, for example *o = (x AND y) OR z* where *o* is the output and *x*, *y* and *z* are the inputs (each of which can have a value of either 1 or 0). Each of these types of representation has its potential advantages -- for example the graphical representation is a very human-friendly representation while the algebraic specification allows for optimization of the circuits using algebraic methods. Many hardware design languages therefore allow to use and combine different methods of describing logic circuits (some even offer more options such as describing the circuit behavior in a programming language such as [C](c.md)).
|
||||
Logic circuits can be drawn simply as "boxes" (which one the base level are the basic logic gates such as [AND](and.md), [OR](or.md) etc.) connected with lines ("wires", but again not really electronic wires as here only 1 or 0 can be carried by such wire). But as mentioned, their behavior can also be described with a truth table (which however says nothing about the internals of the circuit) or a boolean expression, i.e. an algebraic expression that for each of the circuit outputs defines how it is computed from the outputs, for example *a = !x & y* and *b = !(y | z)* for the above drawn example circuit. Each of these types of representation has its potential advantages -- for example the graphical representation is a very human-friendly representation while the algebraic specification allows for optimization of the circuits using algebraic methods. Many hardware design languages therefore allow to use and combine different methods of describing logic circuits (some even offer more options such as describing the circuit behavior in a programming language such as [C](c.md)).
|
||||
|
||||
With combinational logic circuits it is possible to implement any boolean function (i.e. "functions only with values 1 and 0"); [undecidability](undecidability.md) doesn't apply here as we're not dealing with [Turing machines](turing_machine.md) computations because the output always has a finite, fixed number of bits, the computation can't end up in an infinite loop as there are no repeating steps, just a straightforward propagation of input values to the output. It is always possible to implement any function at least as a [look up table](lut.md) (which can be created with a [multiplexer](multiplexer.md)). Sequential logic circuits on the other hand can be used to make the traditional computers that work in steps and can therefore get stuck in loop and so on.
|
||||
|
||||
|
@ -37,11 +49,14 @@ Minimization (or optimization) is a crucial and **extremely important** part of
|
|||
|
||||
Some basic methods of minimization include:
|
||||
|
||||
- **algebraic methods**: We use known logic formulas to simplify the logic expression representing our circuit. This is basically the same as simplifying fractions and similar mathematical expressions. Some common formulas we use:
|
||||
- **De Morghan Laws**: TODO
|
||||
- TODO ...
|
||||
- **Karnaugh maps**: TODO
|
||||
- **Quine McCluskey**: TODO
|
||||
- **algebraic methods**: We use known formulas to simplify the logic expression representing our circuit. This is basically the same as simplifying fractions and similar mathematical expressions, just in the realm of boolean algebra. Some common formulas we use:
|
||||
- **De Morghan Laws**: !x & !y = !(x | y), !x | !y = !(x & y)
|
||||
- [distributivity](distributivity.md): x | (y & z) = (x | y) & (x | z), x & (y | z) = (x & y) | (x & z)
|
||||
- x | !x = 1, x & !x = 0, x | x = x, x & x = x
|
||||
- x | (!x & y) = x | y, x & (!x | y) = x & y
|
||||
- ...
|
||||
- **[Karnaugh maps](karnaugh_map.md)**: One of the most basic methods, simple algorithm using a table.
|
||||
- **[Quine McCluskey](quine_mccluskey.md)**: A bit more advanced method.
|
||||
- ...
|
||||
|
||||
Example of minimization will follow in the example section.
|
||||
|
@ -147,4 +162,6 @@ b1 -----| |------- s1
|
|||
___ | c0
|
||||
a0 -----|HA |-'
|
||||
b0 -----|___|------- s0
|
||||
```
|
||||
```
|
||||
|
||||
TODO: sequential one?
|
Loading…
Add table
Add a link
Reference in a new issue