25
Computer logic Data and programs in digital computers are represented and processed by electronic circuit networks called digital logic circuits or logic circuits, for short. Logic circuits are the heart of computer hardware. Logic circuits operate on two logical values, usually called bit 0 and bit 1, and the operations are based on the principles of Boolean Algebra.

Computer logic Data and programs in digital computers are represented and processed by electronic circuit networks called digital logic circuits or logic

Embed Size (px)

Citation preview

Computer logic

• Data and programs in digital computers are represented and processed by electronic circuit networks called digital logic circuits or logic circuits, for short.

• Logic circuits are the heart of computer hardware.

• Logic circuits operate on two logical values, usually called bit 0 and bit 1, and the operations are based on the principles of Boolean Algebra.

• Logical circuits are made from two basic devices – Logic gate – Flip-flop

• Flip-flops provide memory for storing data while logic gates provide operations on, or functions of, the values stored in these memory devices.

• Logic gate is a combinational circuit that performs an elementary logic operation.

Computer logic

Logic function and truth table

• The values of input x1 and x2 and the corresponding value y of each basic logic gate is represented in it truth table.

• The truth table lists all possible switch setting (input values) along with value of the result (output value) for each setting.

• In general logic terms, this truth table represents the function values y of two variables x1 and x2 values as

y = f(x1, x2)

and may be extended to n variable as the logic function y = f(x1,x2,...,xn)

• Basic logic gates can be used to construct logic network (network of logic gates) or logic circuit that implements more complex logic function (Boolean function).

Logic Function and Truth Table

Logic Function and Truth Table• At any moment, the output signal of a gate is a function of the input signals at that moment.

• The AND gate can have two or more inputs and one output.– The output is 1 if and only if all the inputs are 1s.– Otherwise it is 0.

• The OR gate can have two or more inputs and one output.– The output is 1 if any of the inputs is 1.– Otherwise it is 0.

• Not gate or “inverter” has one input and one output which is always the opposite of the input.

• Truth table is important way for describing logic function values.

• Any logic function with n inputs and one output, the corresponding truth table will have one column for each input, and one column for the output.

• The truth table will have one row for every possible combination of inputs; 2n rows in all.• The output column in each row simply specifies

the output for that combination of inputs.

Logic Function and Truth Table

• The logic function :

Y = A·B + A·B

• The corresponding truth table :

1001

1000

0001

1010

1100

Y= A· B + A· B

A . BA . BBA

Logic Function and Truth Table

The corresponding logic circuit

Y = A·B + A·B

AB

Logic Function and Truth Table

Boolean Function and Boolean Expression

• There are two important problems of Boolean functions and Boolean expressions :– Given the values of a Boolean function, how

can a Boolean expression that represent this function be found ?

– Is there a smaller set of operators that can be used to represent all Boolean functions ?

• Both of these problems have practical importance in circuit design.

• Methods of representing of Boolean functions– Sum-of-products expansions (minterm

expansions )– Product-of-sums expansions (maxterm

expansions )

Boolean Function and Boolean Expression

Boolean Function and Boolean Expression

• Find Boolean expressions that represent the Boolean functions F(x,y,z) and G(x,y,z) below :

x y z F(x,y,z) G(x,y,z)0 0 0 0 00 0 1 0 00 1 0 0 10 1 1 0 01 0 0 0 01 0 1 1 01 1 0 0 11 1 1 0 0

F(x,y,z) =

x y

z= xyz + xy z

G(x,y,z)

exclusive-OR ( x y ) x y x y0 0 00 1 11 0 11 1 0

• Sum-of-products expansions

f(x, y) = 1 when x = 1 and y = 0

x = 0 and y = 1

x y = x•y + x•y

exclusive-OR ( x y ) x y x y0 0 00 1 11 0 11 1 0

• Product-of-sums expansions

x y = (x+y) • (x+y)

f(x, y) = 0 when x = 1 and y = 1 x = 0 and y = 0

Boolean Function

• The Boolean functions F and G of n variables are equal if and only if

F( b1 , b2 , … , bn) = G( b1 , b2 , … , bn )

whenever b1, b2 , … , bn belong to B = { 0 , 1 }

• Two different Boolean expressions that represent the same Boolean function are called equivalent Boolean expressions.

Boolean Function

Example

• To show F( x , y, z ) = G( x , y, z )

where

F( x , y, z ) = x + y•z

G( x , y,z ) = ( x + y ) •( x + z )

x y z F(x,y,z) G(x,y,z)0 0 0 0 00 0 1 0 00 1 0 0 00 1 1 1 11 0 0 1 11 0 1 1 11 1 0 1 11 1 1 1 1

F( x , y, z ) = x + y•zG( x , y,z ) = ( x + y ) •( x + z )

Sj = Aj + Bj Cj

Aj

Bj

Cj-1

CCircuit

Output

C2

S1

S2

0

C1

A1 B1

A2 B2Cm-

1

Sm

Am Bm C

Circuit

CCircuit

CCircuit

Cm

Input

Elements of computer hardware

Transistors

Group of transistors

ICs

Circuit boards

Computer

• Transistors are the smallest computational elements.

• Boolean functions and memories are formed by groups of transistors.

• Elementary addition and multiplication is done by boolean functions and memory elements called flip-flops.

• Integrated circuits (ICs) contain a large number of such functions.

Elements of computer hardware

• Printed circuits boards contain severeral integrated circuits to form a either a full computer or specific I/O (input/output) functions.

• Massive storage such as disks and tapes interfaces the computer through its main bus.

Elements of computer hardware

Functional organization

CPU

Main memory

I/O interface

Bus translator

I/O interface

Bus

Integrated circuits

• The logic gates AND, OR, NOT are the basic components of digital logic circuits of computers. However, these three gates are in principle sufficient to construct a logic circuit of any kind.

• The number of gates that are combined in a single integrated circuit (IC) is often used to distinguish different levels of IC manufacturing.

• Four levels of IC chips are recognized :– Small-scale integration ( SSI )

• 1 to 9 gates per chip

– Medium-scale integration ( MSI )• 10 to 99 gates per chip

– Large-scale integration ( LSI )• 100 to 100,000 gates per chip

– Very large-scale integration ( VLSI )• over 100,000 gates per chip

Integrated circuits

• An integrated circuit (IC) is a microelectronic device consisting of many interconnected transistors and other components.

• ICs are constructed (‘fabricated’) on a small rectangle, called a ‘die’, cut from a silicon (or for special applications, sapphire) wafer.

Integrated circuits

• ICs can be classified into analog, digital, or hybrid (both digital and analog on the same chip).

• Digital ICs can contain anything from one to millions of logic gates, flip-flops, multiplexers, etc. in a few square millimeters.

• The small size of ICs allows high speed, low power dissipation, and reduced manufacturing cost compare with board-level integration.

Integrated circuits