Logic Gates – Formal Introduction

In the previous example we used statements as propositions.  Computer logic is accomplished by using logic gates as building blocks.  A logic gate is a physical circuit which has electrical inputs and usually a single output.

Used in truth tables, we label each input and use truth values to represent weather or not an input is on or off. 

We use the value true , T , 1 to represent on and false , F , 0 to represent off.

Sometimes, On is refered to as a high voltage and off is referred to as a low or no voltage.

The most common gates are shown in the table below:

Gate

AND

OR

NOT

NAND

NOR

XOR

Symbol

AND ANSI Labelled

OR ANSI Labelled

Buffer ANSI Labelled

NAND ANSI Labelled

NOR ANSI Labelled

XOR ANSI Labelled

Inputs

 

A

B

Q=AB

Q=A+B

Q = A

Q= AB

Q=   A+B

Q= A B

0

0

0

0

1

1

1

0

0

1

0

1

1

0

1

1

0

0

1

0

1

0

1

1

1

1

1

0

0

0

 

Description

Outputs 1 when all inputs are 1

Outputs 1 when ANY input is a 1

Inverts the input

Outputs 0 where all inputs are 1

Outputs 1 then both inputs are 0

Outputs 1 when exactly one input is 1

Outputs 0 otherwise

Outputs 0 otherwise

 

Outputs 1 otherwise

Outputs 0 otherwise

Outputs 0 otherwise

Typing the mathematical notation into most word processors can be challenging. Sometimes these worded expressions or symbols are used :

GateWorded expressionSymbol Expression
ANDA AND BA^B
ORA OR BA v B
NOTNOT A~A
NANDNOT( A AND B) ~(A^B)
NORNOT (A OR B)~(A v B)
XORA XOR BA B

© 2021  Vedesh Kungebeharry. All rights reserved. 

Logic Gates

Logic gates are electronic combinational circuits which contain one or more electrical inputs and usually one output.

A combinational circuit’s output depends on the state of it’s inputs.

We use truth tables to document the  behaviour of a logic gates.

In class demonstration

Demonstrate an AND gate and describe with a truth table and in words

(Teacher constructs the truth table from description for a 2 input and a 3 input gate)

An AND gate’s  output is true only when both inputs are true”

Homework/In class exercise

Draw the truth table for  the following gates

  1. AND
  2. OR
  3. NOT
  4. ExOR
  5. NAND

Describe their outputs or mode of operation using a well formed sentence in English. E.g “An AND gate’s  output is true only when both inputs are true”

© 2021  Vedesh Kungebeharry. All rights reserved. 

Truth Tables – An application of abstraction to physical circuits to arrive at their logical nature

Warning: I wrote to following paper to maintain a high level of precision when considered  formally under the disciplines of mathematical logic and computer science. This allows for the proper consideration of semantics in future discussions. 

This writing may lead you to believe that you are taken along a platitude of truism devoid of axiomatic purpose that amounts to a march of banality unrivaled in the history of human thought.

Let us begin.

Definition :  A truth table lists  all possible unique inputs to a logic function accompanied by each output value.

A truth table uses the veracity of propositions. Veracity refers to truthfulness, whether the statement is true or false.   A proposition is a statement.

e.g.      let P be the proposition ‘it is raining’.   

            We can assign 2 values to P.  That is,    

P = truemeaning that ‘the statement P is true’
P = falsemeaning ‘the statement P is false.

NOTE:  We can use the following symbols for truth values:

VALUESYMBOL
TrueTrue,  T, 1
FalseFalse, F, 0

In the above example, the proposition for P can be written as the following table:

P
True
False

Note, the proposition has no meaning when taken by itself. Here we only see the possible circumstances described by the statement as it can be used as an input to a logical scenario or taken s the output of a scenario.

I now introduce…

Truth tables in computer science

In this context, Truth tables  can be used to represent the voltages that are applied as input to a circuit and the resulting output.

Though it may seem trivial, we consider a simple circuit with one input or switch , a battery, and a one output or lightbulb:

Simple circuit diagram

Approaching this physical construct of discrete possible events using mathematical logic we say:

Let the input be called I , and we use the convention that a value of 1 means that a high voltage is applied to the bulb and a 0 being the falsehood of “a high voltage is applied to the bulb ” or rather we can say a high voltage is not applied to the bulb or simply no voltage is applied to the bulb.

Another school as thought would describe I having a value 1 as the switch is on and I having a value of 0 as the switch is off.

Let the output of the circuit be O using the convention that a value of 1 means that the bulb is lit and a value of 0 means the falsehood of “the bulb is lit” or rather we can say the bulb is not lit or simply the bulb is unlit.

Yet another school of thought would describe O having a value of 1 as a high voltage was observed at the output and O having a value of 0 as low or no voltage observed at the output

Now we are ready to consider these discrete events devoid of timing to form an enumeration or superposition of sorts that is a truth table.

We arrive at the following truth table which list all possible inputs to the “circuit” and the observed outputs:

IO
11
00

This table tells us,

For an input of 1:

  • If a high voltage is applied to the bulb , the bulb is lit
  • If a high voltage is applied to the bulb then the statement “the bulb is lit” is True
  • If a high voltage is applied to the bulb , a high voltage was observed at the output.
  • If the switch is on, the bulb is lit

For an input of 0

  • If a high voltage is not applied to the bulb, the bulb is unlit
  • If no voltage is applied to the bulb, then the statement “the bulb is lit” is False
  • If no voltage is applied to the bulb , low or voltage was observed at the output.
  • If the switch is off, the bulb is unlit.

Our truth table allows for us to perform an abstraction on our circuit so that we no longer consider the events that physically occur in the circuit, rather the ideas on how the circuit’s output behaves given discrete inputs.

We no longer care about how the circuit is physically implemented; rather we only consider the logical implications of using the particular type of circuit as a building block in other circuits.

Thank you for reaching the end of this paper.

Attributions to media used in this post:

يحيى بن علي, CC BY-SA 4.0, via Wikimedia Commons

© 2021  Vedesh Kungebeharry. All rights reserved. 

SBA Website Feedback (2021-22)

This was feedback given for submitted websites before requesting a final submission on Wed 20th Oct 2021. Students will view the feedback and ask for clarifications on Mon 18th Oct 2021 during class. This feedback was posted on Sunday 17th Oct 2021.

The deadline is subject to change based on our discussions in class on Monday 18th Oct 2021.

Group 1


Group 2


Group 3


Group 4


Group 5


Group 6


Group 7

© 2021  Vedesh Kungebeharry. All rights reserved. 

Categories Of Computers

There are various types of computers and used in the world today. You may already be accustomed to desktop computers and laptops, and this goes without saying – even your mobile devices.

Here, we take a more formal approach by creating an exhaustive list of categories based on the purpose of the computers in each category. The list includes:

  • supercomputers
  • mainframe computers
  • mini computers
  • Micro computers
    • desktop pc
    • laptop computer
    • tablet computer
    • mobile devices

  • embedded systems

Supercomputers

Trinity (supercomputer)
(Los Alamos National Laboratory, Attribution, via Wikimedia Commons.)

Supercomputers are the fastest, most expensive computers in the world. They are specialized computers that are used mainly for scientific research and simulations

They are much faster than the regular general purpose computers (example: desktop PC) that we use every day, approximately 100 million times faster.

They are capable of storing a vast amount of data for processing.

They are very large, and can occupy the space of an entire floor in a  large building. Because of the high amounts of processing and the size of the supercomputer they consume a lot of electrical power which adds to the expense of running a supercomputer.

It should come as no surprise that’s super computers are very expensive. There aren’t a lot of supercomputers in the world for this reason, and scientists share their time with each other when using a supercomputer.

Supercomputers are used for various complex applications, most of them beyond on the scope of our study but one relatable  example would be in the simulation of weather systems for weather forecasting.

Mainframe Computers

<a title=”Erik Pitti from San Diego, CA, USA, CC BY 2.0 , via Wikimedia Commons” href=”https://commons.wikimedia.org/wiki/File:IBM_System_360_Mainframe_(2371701458).jpg”>IBM System 360 Mainframe (2371701458)
(Erik Pitti from San Diego, CA, USA, CC BY 2.0 https://creativecommons.org/licenses/by/2.0, via Wikimedia Commons)

Mainframe computers were built to be used by many people and an organization at the same time. It is a very large computer system and can fill up an entire room.

Multiple users connect to the mainframe computer via multiple terminals which consist of at least a monitor and keyboard.  Many other peripheral devices are also connected to the mainframe computer example printers, scanners external disk drives etc.

Although mainframe computers are very fast and can store a lot of data, they are much less expensive than a supercomputer.

Mainframe computers are used by medium size to large businesses for example, banks and insurance companies.

Mini Computer

K-202 minicomputer
(K-202 minicomputer, Olaf, Public domain, via Wikimedia Commons)

Mini computers can be thought of as a smaller version of a mainframe computer intended to be more accessible and affordable to smaller businesses.

 Computers  Server

<a title=”Cskiran, CC BY-SA 4.0 , via Wikimedia Commons” href=”https://commons.wikimedia.org/wiki/File:Multiple_Server_.jpg”&gt;Multiple Server
Multiple Servers in a server rack (Cskiran, CC BY-SA 4.0 https://creativecommons.org/licenses/by-sa/4.0, via Wikimedia Commons)

Computer servers do exactly what their names imply.  They provide services across a computer network to other computers known as clients computers. Client computers can be any class of micro computer ( desktop PC’s, laptop computers, tablet computers and mobile devices ) or even another Server itself.

The most common example would be a print server on a network or a website server on the Internet.

In the case of a print server in an office, workers can access the printer across the computer network to print various documents.  This reduces the need for multiple printers.

In the case of the web server on the Internet, web pages are served to different users who use web browsers on their computers to access the server via a web address.

Micro computers

<a title=”John crane 59, CC BY-SA 3.0 , via Wikimedia Commons” href=”https://commons.wikimedia.org/wiki/File:Microcomputer_Collection.jpg”&gt;Microcomputer Collection
A collection of 70's era microcomputers: SWTPC 6800, Altair 8800 (running a Dazzler program), an Altair 8800B, and an AC-30 Cassette tape interface. (John crane 59, CC BY-SA 3.0 https://creativecommons.org/licenses/by-sa/3.0, via Wikimedia Commons)

These computers fall into the category of average everyday personal use. they are not intended to be used by many people, only a single user at a time.

They include desktop PC’s, laptop computers, tablet computers and mobile devices.

Their  processing power is generally lower than a mainframe or mini computer but powerful enough to suit their needs of the user.

They are affordable enough to have widespread use across the entire world today.

Embedded computers

<a title=”Binary Koala from Berlin / Saint-Petersburg, TCP/IP, CC BY-SA 2.0 , via Wikimedia Commons” href=”https://commons.wikimedia.org/wiki/File:Network_enabled_embedded_computer_board_-_London_Science_Museum,_2015-03-19_(by_Binary_Koala).jpg”>Network enabled embedded computer board - London Science Museum, 2015-03-19 (by Binary Koala)
Network enabled embedded computer board - London Science Museum, 2015-03-19  (Binary Koala from Berlin / Saint-Petersburg, TCP/IP, CC BY-SA 2.0 <https://creativecommons.org/licenses/by-sa/2.0>, via Wikimedia Commons)

These are small specialized computer systems that are integrated into mechanical and or electrical machines.

For example, the microwave oven in your kitchen contains an embedded computer system which is able to be controlled via the keypad. the system is responsible for starting and stopping the operation of the microwave oven as well as controlling the power delivered to the microwave oven via the use of temperature sensors.

Embedded computers can be found in many household appliances and vehicles.

© 2021  Vedesh Kungebeharry. All rights reserved.