[go: up one dir, main page]

0% found this document useful (0 votes)
73 views18 pages

Desktop Operating System - Computer: AND Gate

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 18

desktop operating system - Computer

Definition

The control program in a user's machine (desktop or laptop). Also called a "client operating
system," Windows is the overwhelming majority while the Macintosh comes second. There
are also several versions of Linux for the desktop. Contrast with network operating system.

Logic gates

Digital systems are said to be constructed by using logic gates. These gates are the
AND, OR, NOT, NAND, NOR, EXOR and EXNOR gates. The basic operations
are described below with the aid of truth tables.

AND gate

The AND gate is an electronic circuit that gives a high output (1) only
if all its inputs are high.  A dot (.) is used to show the AND operation i.e.
A.B.  Bear in mind that this dot is sometimes omitted i.e. AB

OR gate

The OR gate is an electronic circuit that gives a high output (1) if one or
more of its inputs are high.  A plus (+) is used to show the OR operation.

NOT gate
The NOT gate is an electronic circuit that produces an inverted version of
the input at its output.  It is also known as an inverter.  If the input variable
is A, the inverted output is known as NOT A.  This is also shown as A', or A
with a bar over the top, as shown at the outputs. The diagrams below show
two ways that the NAND logic gate can be configured to produce a NOT
gate. It can also be done using NOR logic gates in the same way.

NAND gate

This is a NOT-AND gate which is equal to an AND gate followed by a NOT


gate.  The outputs of all NAND gates are high if any of the inputs are low.
The symbol is an AND gate with a small circle on the output. The small
circle represents inversion.

NOR gate

This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate.


The outputs of all NOR gates are low if any of the inputs are high.

The symbol is an OR gate with a small circle on the output. The small circle
represents inversion.

 
 

EXOR gate

The 'Exclusive-OR' gate is a circuit which will give a high output if either,
but not both, of its two inputs are high.  An encircled plus sign ( ) is used
to show the EOR operation.

EXNOR gate

The 'Exclusive-NOR' gate circuit does the opposite to the EOR gate. It will give a
low output if either, but not both, of its two inputs are high. The symbol is an
EXOR gate with a small circle on the output. The small circle represents inversion.

The NAND and NOR gates are called universal functions since with either one the
AND and OR functions and NOT can be generated.

Note:

A function in sum of products form can be implemented using NAND gates by


replacing all AND and OR gates by NAND gates.

A function in product of sums form can be implemented using NOR gates by


replacing all AND and OR gates by NOR gates.

Table 1: Logic gate symbols


Table 2 is a summary truth table of the input/output combinations for the NOT gate
together with all possible input/output combinations for the other gate functions.
Also note that a truth table with 'n' inputs has 2n rows. You can compare the
outputs of different gates.

Table 2: Logic gates representation using the Truth table

 Example

A NAND gate can be used as a NOT gate using either of the following wiring


configurations. 

                                        (You can check this out using a truth table.)

 
< Tutorials

This article makes use of diagrams in the MCRedstoneSim format for compactness and


clarity.

Some of the designs are more than two blocks high which is represented here by the layers
being frames in an animated gif or labeled side by side. A full legend is on the Redstone
schematics page.

Logic gates in Minecraft are a way of using redstone circuits in a manner that a certain
combination of inputs, or redstone signals, achieves a certain output. They are similar to
computer logic gates in a way, but are slightly different in their constructs.

Contents
  [hide] 

 1 Basic Info
 2 Key for Diagrams
 3 Using Logic Gates
 4 Examples of Logic Gates
o 4.1 NOT Gate
o 4.2 AND Gate
o 4.3 NAND Gate
o 4.4 OR Gate
o 4.5 NOR Gate
o 4.6 XOR Gate
o 4.7 XNOR Gate

 5 Diodes
o 5.1 Repeater
o 5.2 Torch Repeater
o 5.3 Glowstone, Stairs, and Slabs

 6 Video
 7 See also

Basic Info[edit]
Some basic info about Minecraft needed to understand redstone circuits and gates:

 There are several items that can provide an input charge into redstone. These
are levers, pressure plates, redstone torches, redstone blocks, buttons, detector
rails, tripwire hooks and daylight sensors.
 Switches are most commonly used with gates because of their ease of use and the fact
that they are easily made.
 When redstone torches are powered, they go into an "off" state and stop providing power
themselves.
 Any block can have redstone placed on it except leaves and glass, with a few more
exceptions.
 Glowstone can have redstone wire placed on it, but not torches or repeaters.
 Redstone wire can no longer be placed on Glowstone in the Xbox version as of
Version 1.3 (TU7).

Key for Diagrams[edit]

Using Logic Gates[edit]

The most basic gate you can have. When the input signal is on, the output signal is on, and vice versa.
Interactive Schematic

One uses gates when they need a different signal pattern than a simple on/off pattern, but a gate
can be as simple as that: an On-On, Off-Off gate. However, other gates are used when one
wants to have a signal go on when a certain combination of events happens. For instance, if you
wanted to have a redstone lamp light only when two switches were both toggled to the "on"
position, you would use an AND gate. If you wanted no signal when a switch is on, but wanted a
signal when a switch is off, you would use a NOT gate. Lighting in modern buildings controlled by
two or more switches (for example: a light in a hallway with a switch at each end) use XOR
gates.
Gates can be used in combinations to create complex signal patterns, and some have even
successfully created redstone computers using logic gates. SeeTutorials/Advanced redstone
circuits for more info.

Examples of Logic Gates[edit]


NOT Gate[edit]

The most commonly used NOT gate. Also called an inverter.


Interactive Schematic

A NOT gate (¬A), also known as an inverter, is a gate used when you want an opposite output
from the input you give. For instance, when the switch, or input, is set to "on", the output will be
toggled to "off", and when the switch is toggled to "off", the output will be toggled to "on".

Inpu
Output
t

ON off

off ON

AND Gate[edit]

A commonly-used AND gate.


Interactive Schematic

An AND gate (A^B) is used with two or more switches or other inputs. The output is toggled to
"on" ONLY when both switches, or inputs, are toggled to "on". Otherwise, the output will remain
"off".

Input 1 Input 2 Output

ON ON ON
ON off off

off ON off

off off off

NAND Gate[edit]

A commonly used NAND gate. Note the similarities to the AND gate.
Interactive Schematic

A NAND gate -(A^B) is the opposite to the AND gate. The output is toggled to "off" ONLY when
both switches are toggled to "on". Otherwise, the output is set to "on". This gate also requires two
or more inputs.

Input 1 Input 2 Output

ON ON off

ON off ON

off ON ON

off off ON

OR Gate[edit]

Two isolated OR gates. These can have up to 3 normal inputs, or more if inverted inputs are used with redstone
torches above and/or below the yellow block or output dust.
An implicit OR gate. This is the simplest gate available and therefore easily forgotten. This gate is potentially
dangerous as signals may flow back to any circuitry attached to the inputs. This has been solved with diodes in
the circuit on the right. The number of inputs is only limited by the available signal strengths. Using
the transparent block trick, even more inputs can be added.

An OR gate (AVB) uses two or more inputs. Whenever any input is "on", the output is to "on".
The only time the output is "off" is when all inputs are "off".

Input 1 Input 2 Output

ON ON ON

ON off ON

off ON ON

off off off

NOR Gate[edit]

A NOR gate. Note the similarities to the OR gate.


Interactive Schematic

A NOR gate -(AVB) is the opposite of the OR gate. Whenever at least one switch is toggled to
"on", the output is toggled to "off". The only time the output is "on" is when all inputs are toggled
to "off". This gate also uses two or more inputs.

Input 1 Input 2 Output

ON ON off
ON off off

off ON off

off off ON

XOR Gate[edit]

Input 1 Input 2 Output

ON ON off

ON off ON

off ON ON

off off off

An XOR gate (A⊕B) is a gate that uses two inputs. In this gate, the output is toggled to "on"
when one switch is "on" and one switch is "off". If both switches are in the same position, the
output is toggled to "off". Because of these properties, XOR gates are commonly found in
complex redstone circuits.

A commonly-used XOR gate.

A Comparator XOR Gate.

 

A Comparator XOR gate with side-by-side inputs.


XNOR Gate[edit]

A commonly-used XNOR gate. Note the similarities to the XOR gate.


Interactive Schematic

An XNOR gate (A⇔B) is the opposite of an XOR gate. It uses two inputs. When both switches
are in the same state (both switches are "on" or both switches are "off"), then the output is
toggled to "on". Otherwise, if the switches differ, the output is toggled to "off".

Input 1 Input 2 Output

ON ON ON

ON off off

off ON off

off off ON

Logic Gates
Introduction
Logic gates serve as the building blocks to digital logic circuits using combinational
logic. We're going to consider the following gates: NOT gates (also called
inverters), AND gates, OR gates, NAND gates, NOR gates, XOR gates, and XNOR
gates.

We'll also discuss the concept of gate deltay.

NOT gates
NOT gates or inverters have a single bit input and a single bit of output.

This is a diagram of a NOT gate. It is a triangle with a circle on the right. The
circle indicates "negation".

The truth table defines the behavior of this gate.

  x     z  

0 1

1 0

where x is the input and z is the output.

AND2 gates
AND2 gates have two bits of input and a single bit of output. The subscript, 2,
indicates how many inputs this AND gate has. For example, AND3 gates have 3
inputs.

The output of AND2 gate is 1 only if both inputs are 1. Otherwise, the output is 0.

The truth table defines the behavior of this gate.

  x1     x0     z  

0 0 0

0 1 0
1 0 0

1 1 1

The function implmented by AND2 gates has interesting properties:

 The function is symmetric. Thus, x * y == y * x. This can be verified by using


truth tables. We use * to represent AND2.
 The function is associative. Thus, (x * y) * z == x * (y * z). This can be
verified by using truth tables.

Because of these properties, it's easy to define ANDn, which is an n-


input AND gate.
ANDn(x1, x2,...,xn) = x1 * x2 * ... * xn

That is, an AND gate with n-inputs is the AND of all the bits. This is not
ambiguous because the AND function is associative (all parenthesization of this
expression are equivalent).

OR2 gates
OR2 gates have two bits of input and a single bit of output. The subscript, 2,
indicates how many inputs this OR gate has. For example, OR 3 gates have 3 inputs.

The output of OR2 gate is 0 only if both inputs are 0. Otherwise, the output is 1.

The truth table defines the behavior of this gate.

  x1     x0     z  

0 0 0

0 1 1

1 0 1

1 1 1

The function implemented by OR2 gates has interesting properties:


 The function is symmetric. Thus, x + y == y + x. This can be verified by using
truth tables. We use "+" to represent OR2
 The function is associative. Thus, (x + y) + z == x + (y + z). This can be
verified by using truth tables.

Because of these properties, it's easy to define ORn, which is an n-input OR gate.


ORn(x1, x2,...,xn) = x1 + x2 + ... + xn

That is, an AND gate with n-inputs is the AND of all the bits. This is not
ambiguous because the AND function is associative (all parenthesization of this
expression are equivalent).

NAND2 gates
NAND2 gates have two bits of input and a single bit of output. The subscript, 2,
indicates how many inputs this NAND gate has. For example, NAND3 gates have 3
inputs.

NANDk gates is define unusually. Since NAND2 is not associative, the definition is


based on AND2.

In particular

NANDk(x1, x2,...,xn) = NOT( ANDk(x1, x2,...,xn) )

Thus, NANDk is the negation of ANDk.

The truth table defines the behavior of this gate. It's the negation of AND2.

  x1     x0     z  

0 0 1

0 1 1

1 0 1

1 1 0

The function implemented by NAND2 gates has interesting properties:


 The function is symmetric. Thus, x NAND y == y NAND x. This can be
verified by using truth tables.
 The function is not associative. This can be verified by using truth tables.

Because of these properties, NANDk is defined from ANDk, and not built


from NAND2 gates.
NOR2 gates
OR2 gates have two bits of input and a single bit of output. The subscript, 2,
indicates how many inputs this OR gate has. For example, NOR 3 gates have 3
inputs.

The output of NOR2 gate is the negation of OR2.

The truth table defines the behavior of this gate.

  x1     x0     z  

0 0 1

0 1 0

1 0 0

1 1 0

The function implmented by NOR2 gates has interesting properties:

 The function is symmetric. Thus, x NOR y == y NOR x. This can be verified


by using truth tables.
 The function is not associative. This can be verified by using truth tables.

Because of these properties, NORk is defined from ORk, and not built


from NOR2 gates.
XOR2 gates
XOR2 gates have two bits of input and a single bit of output.
The output of XOR2 gate is 1 only if the inputs have opposite values. That is, when
one input has value 0, and the other has value 1.. Otherwise, the output is 0.

This is called exclusive-or. The definition of OR2 is inclusive-or, where the output


is 1 if either input is 1, or if both inputs are 1.

XOR2 can be defined using AND2, OR2, and NOT.

x XOR y == ( x AND (NOT y) ) OR ( (NOT x) AND y ) ==


x\y + y\x
Here's a diagram of the XOR2 gate.

If you look carefully at the drawing of the gate, there is a second arc behind the
first one near the inputs. Since this second arc is hard to see, it's usually a good
idea to write the word "XOR" inside the gate.

The truth table defines the behavior of this gate.

  x1     x0     z  

0 0 0

0 1 1

1 0 1

1 1 0

The function implmented by XOR2 gates has interesting properties:

 The function is symmetric. Thus, x (+) y == y (+) x. This can be verified by


using truth tables. (We use (+) to denote logical XOR--ideally, we'd draw it
with a + sign inside a circle, but HTML doesn't seem to have a symbol for
this).
 The function is associative. Thus, [ x (+) y ] (+) z == x (+) [ y (+) z ]. This can
be verified by using truth tables.

Because of these properties, it's easy to define XORn, which is an n-


input XOR gate.
XORn(x1, x2,...,xn) = x1 (+) x2 (+) ... (+) xn

That is, an XOR gate with n-inputs is the XOR of all the bits. This is not
ambiguous because the XOR function is associative (all parenthesization of this
expression are equivalent).

XNOR2 gates
XNOR2 gates have two bits of input and a single bit of output.

The output of XNOR2 gate is the negation of XOR2 and has 1 when both inputs are
the same.

If you look carefully at the drawing of the gate, there is a second arc behind the
first one near the inputs. Since this second arc is hard to see, it's usually a good
idea to write the word "XNOR" inside the gate.

The truth table defines the behavior of this gate.

  x1     x0     z  

0 0 0

0 1 1

1 0 1

1 1 0

The function implmented by XNOR2 gates has interesting properties:

 The function is symmetric. Thus, x XNOR y == y XNOR x. This can be


verified by using truth tables.
 The function is associative. Thus, (x XNOR y) XNOR z == x XNOR (y XNOR z).
This can be verified by using truth tables.

Because of these properties, it's easy to define XNORn, which is an n-


input XNOR gate.
XNORn(x1, x2,...,xn) = x1 XNOR x2 XNOR ... XNOR xn
That is, an XNOR gate with n-inputs is the XNOR of all the bits. This is not
ambiguous because the XNOR function is associative (all parenthesization of this
expression are equivalent).

A handheld computer is a computer that can conveniently be


stored in a pocket (of sufficient size) and used while you're
holding it.

You might also like