EC303 - CHAPTER 4 ARITHMETIC LOGIC UNIT ALU

Post on 28-Apr-2015

163 views 2 download

description

-

transcript

ARITHMETIC LOGIC UNIT (ALU)

CHAPTER 4

Learning Outcomes

• At the end of this lesson, student should able:-– Understanding adder component in ALU such

as Half Adder, Full Adder, Parallel Binary Adder, Binary Code Decimal Adder etc.

– Understanding shift register operation in ALU– Understanding logical operations in ALU– Realize multiplexer in ALU with eight input

multiplexer.

Introduction

• A logic circuit, which is used to perform

arithmetic functions like addition, subtraction,

multiplication, division etc. is called arithmetic

circuit.

• Typically, an addition operation takes less than 1

µs.

• The logic functions that are commonly used are

EX-OR, OR and AND.

Adder

• In electronics an adder is digital circuit that perform

addition of numbers.

• In modern computer adder reside in the arithmetic

logic unit (ALU).

• Adders are important not only in the computer but

also in many types of digital systems in which the

numeric data are processed.

• There are two basic types of adder:-

– Half Adder & Full Adder

The Half Adder

• The half-adder accepts two binary digits on its inputs and produces two binary digits on its outputs, a sum bit and a carry bit.

Logic Circuits

Simplify to

HOW ???

• Drawback of half adder is, it doesn’t cater to carry i.e. it fails in multi-bit addition.

• It will add A0 and B0, but in next stage we have to add three bits, which will not be done by the circuit, hence we require a FULL ADDER

Exercise

• Using an AND gate and two NOR gates to construct a half adder

The Full Adder

• To overcome the drawback of half adder, full adder is designed.

• It consider Carry also.• The logic circuit which can add 3 bits is

known as Full Adder.• The full adder produces a sum and carry

value, which are both binary digits. • It can be combined with other full

adders.

Full Adder Logic

• A full adder can be constructed from two half adders

by connecting A and B to the input of one half adder,

connecting the sum from that to an input to the

second adder, connecting Ci to the other input and

OR the two carry outputs.

• Equivalently, S could be made the three-bit XOR of

A, B, and Ci, and Co could be made the three-bit

majority function of A, B, and Ci.

The Full-Adder

Exercise

• Write the equation to perform the full adder logic circuits.

Parallel Binary Adder

• Two or more full adders are connected to form parallel binary adders.– To add two binary numbers, a full-adder

is required for each bit in the numbers. – So, for 2-bit numbers, two adders are

needed.

Parallel Binary Adder

• The carry output of each adder is connected to the carry input of the next higher-order adder

Four-Bit Parallel Adders

• A group of 4 bits is called a nibble. A basic 4-bit parallel adder is implemented with four full-adder stages as shown.

Four-Bit Parallel Adders

The carry output of each adder is connected to the carry input of the next higher-order adder as indicated. These are called internal carries.

Parallel Adder Addition

How to performAddition?

Parallel Adder Subtraction

How to performsubtraction?

Testdefination computer

architecture & organization

cache memory

von nuemann

number systemmnemonic, operandflip-flop (jk flip-flop)