Design & Technology

Electronic logic

Digital circuits are made up of digital switches called gates. Logic gateslogic gate
circuit component which takes several inputs, compares them with each other, and provides a single output based on a logical function such as AND, OR or NOT.
control outputs depending on whether the switches are on or off. A logic gate's behaviour can be described using the terms AND, OR and NOT - or combinations of these.

Programmable interface controllers (PICs) are automated logic gates - digital control devices which can be programmed to behave in preset ways given certain inputs.

Logic gates

Logic gates are at the heart of digital electronics.

A single digital signal can be either ON or OFF, but if there is more than one signal, there are more than two possible states. For example, if there are two signals present there are four possible combinations - ON/ON, ON/OFF, OFF/ON and OFF/OFF - and each combination will produce a different outcome. This is a logic gate.

The graphic shows an AND gate with 2 inputs, both of which can be either ON (represented by 1) or OFF (represented by 0). Because this is an AND gate, both inputs must be ON for there to be an output. The table on the right shows all the possible combinations of inputs and outputs (with the output ON state represented by a 1).

Diagram showing an AND gate with possible outcomes

Diagram showing an AND gate with possible outcomes

Now look at an OR gate with the same inputs. An OR gate allows the output to be ON as long as either A or B are ON. The table on the right - called a truth table - shows all the possible inputs and outputs

Diagram showing and OR gate with the possible outcomes

An OR gate

There are six types of primitive (basic) logic gates that are used in the design of logic systems. The output of the gates is as follows:

  • An AND gate is ON if both input signals are ON.
  • An OR gate is ON if either or both inputs are ON.
  • A NAND (NOT + AND) gate is ON unless both inputs are ON.
  • A NOR gate is ON if both inputs are OFF.
  • A NOT has just one input. The gate is ON if the input is OFF, and OFF if the input is ON. This gate is sometimes called an inverter.
  • An Exclusive OR (XOR) gate is ON if one input is ON and the other is OFF, but will not work if both are ON.

The activity allows you to select input states for different logic gates. The truth table shows the possible outcomes for each gate.

More complex logic systems

Logic gates are used to build up complex logic systems, such as burglar alarms and combination locks.

  • These may be built up of many different primative logic gates.
  • Some logic gates may have more than two inputs. However you are only required to understand the logic of the two-input gates.

The diagram below shows a complex logic gate combining three simple gates. Altogether there are three inputs and eight possible outcomes. To complete a truth table do a whole column before moving to the next column. To solve the table below first find D, then E and finally Z. D depends only on A, E depends on B And C, and X depends on E Or D.

Complex logic gate and associated truth table

Complex logic gate and associated truth table

PICs

PIC stands for peripheral interface controller. It is a type of microcontroller - that is, a computer chip that has been programmed to respond to inputs in preset ways. Essentially a PIC is a mini-computer, complete with memory, on a single chip.

PICs are used in a wide range of applications, including:

  • cellular phones
  • car-control systems
  • burglar alarms
  • microwave ovens, and
  • DVD systems

There are two types of PIC chips.

  • Flash PIC chips can be programmed time and time again. Flash types have an F in their codes - for example 16F84. You may have used 16F84 chips in school.
  • One-time programmable (OTP) chips can be programmed once only. OTP types have a C in their code numbers eg 16C54JW

PIC component functions

Diagram of a microcontroller

Diagram of a microcontroller

  • Clock and timing orchestrates the processors and the program sequences when the PIC program is running.
  • Power is required to run the chip.
  • Processor fetches and carries the instructions from the program and sends them to their correct locations.
  • ROM (read-only memory) stores the information programmed into the chip.
  • Reset will start the program at the beginning again, if required.
  • Control store controls the stored program.

Programming PICs

PIC chips are programmed using computers. Most PIC programs can be represented by a flow chart [flow chart: a graphic outline of the sequence of operations needed to complete a task ] which sets out the required logic sequence.

Once completed the program is downloaded to the chip using a chip holder and cable connected to one of the computer printer ports. This is called blowing the data onto the chip.

Back to Revision Bite