# Digital Electronics and Computer Fundamentals

- 2 -

CORE 2 : DIGITAL FUNDAMENTALS AND ARCHITECTURE

**Subject Description: **This subject deals with fundamentals of digital computers, Microprocessors and System architecture. Goal: To learn about Computer Fundamentals and its Architecture. Objective: On successful completion of this subject the students should have Knowledge on Digital circuits, Microprocessor architecture, and Interfacing of various components.

UNIT-I: Number System and Binary Codes: Decimal, Binary, Octal, Hexadecimal – Binary addition, Multiplication, Division – Floating point representation, Complements, BCD, Excess3, Gray Code. Arithmetic Circuits: Half adder, Full adder, Parallel binary adder, BCD adder, Half subtractor, Full subtractor, Parallel binary subtractor - Digital Logic: the Basic Gates – NOR, NAND, XOR Gates.

UNIT-II: Combinational Logic Circuits: Boolean algebra – Karnaugh map – Canonical form 1 – Construction and properties – Implicants – Don’t care combinations - Product of sum, Sum of products, simplifications. Sequential circuits: Flip-Flops: RS, D, JK, and T - Multiplexers – Demultiplexers – Decoder Encoder – shift registers-Counters.

UNIT-III: Input – Output Organization: Input – output interface – I/O Bus and Interface – I/O Bus Versus Memory Bus – Isolated Versus Memory – Mapped I/O – Example of I/O Interface. Asynchronous data transfer: Strobe Control and Handshaking – Priority Interrupt: Daisy- Chaining Priority, Parallel Priority Interrupt. Direct Memory Access: DMA Controller, DMA Transfer. Input – Output Processor: CPU-IOP Communication.

UNIT-IV: Memory Organization: Memory Hierarchy – Main Memory- Associative memory: Hardware Organization, Match Logic, Read Operation, Write Operation. Cache Memory: Associative, Direct, Set-associative Mapping – Writing into Cache Initialization. Virtual Memory: Address Space and Memory Space, Address Mapping Using Pages, Associative Memory, Page Table, Page Replacement.

UNIT-V: CASE STUDY: Pin out diagram, Architecture, Organization and addressing modes of 80286-80386-80486-Introduction to microcontrollers.

TEXT BOOKS: 1. Digital principles and applications, Albert Paul Malvino, Donald P Leach , TMH,1996. 2.COMPUTER SYSTEM ARCHITECTURE -M. Morris Mano , PHI. 3. MICROPROCESSORS AND ITS APPLICATIONS-RAMESH S.GOANKAR

**REFERENCE BOOKS: **1. DIGITAL ELECTRONICS CIRCUITS AND SYSTEMS - V.K. Puri , TMH. 2. COMPUTER ARCHITECTURE , M. Carter , Schaum’s outline series, TMH.

** SUBJECT: DIGITAL ELECTRONICS AND COMPUTER FUNDAMENTALS**

CLASS : I B.Sc

SEMESTER: II

UNIT : 1

** STAFF: S.FAIZAL RAHMAN**

TOPICS COVERED:

REPRESENTATION OF INFORMATION: NUMBER SYSTEM AND CODES – BINARY TO DECIMAL CONVERSION – DECIMAL TO BINARY CONVERSION – OCTAL NUMBERS – HEXADECIMAL NUMBERS – ASCII CODE – EXCESS- 3 CODE – GRAY CODE.

**1. REPRESENTATION OF INFORMATION:**

Modern computers do not process decimal numbers. Instead they work with binary numbers which use only the digits 0 and 1. Why binary numbers? Because electronic devices are most reliable when designed for two-state (binary) operation.

Some basic features which are common to all digital processing of information which enables us to treat the subject in a unified manner.

These are:

I. All streams of input symbols to a digital system are encoded with two distinct symbols. These symbols are 0(zero) and 1(one) and are known as binary digits or bits. Bits can be stored and processed reliably and inexpensively with currently available electronic circuits.

II. Rules for manipulating symbols are to be precisely specified such that a machine can be built to execute each rule. The rules for manipulation are also encoded using binary digits.

III. A digital computer has a storage unit in which the symbols to be manipulated are stored. The encoded rules for manipulating the symbols are also stored in the storage unit.

IV. Bit manipulation rules are realized by electronic circuits. Examples of simple manipulation rules are: add two bits, compare two bits and move one bit from one storage unit to another. A sequence of rules for accomplishing a complex task may be stored in the storage unit and is called a program.

Digital systems work in a binary fashion, in which only two digits 0 and 1, known as bits are used to specify any number. A group of eight bits is known as byte and a group of four bits is known as a nibble. For example 10010001 is a byte and 1011 is one nibble. Since a digital system understands only 0’s and 1’s, any information, which is usually in numeric, alphabetic or alphanumeric form, is to be suitably converted into the binary language before it can be processed by digital circuits. This process is known as coding.

**Program And Data:**

Data means names, numbers and facts, anything needed to work out a problem. Data goes into a computer, where it is processed or manipulated to get new information. Before it goes into a computer, however the data must be coded in binary form. The reason was given earlier a computers circuits can respond only to binary numbers.

Besides the data, someone has to work out a program, a list of instructions telling the computer what to do. These instructions spell out each and every step in the data processing. Like the data, the program must be coded in binary form before it goes into the computer. Once the computer run starts each instruction is executed and the data is processed.

**2. NUMBER SYSTEMS AND CODES:**

The most widely used number system is the positional system. In this system the position of various digits indicates the significance to be attached to that digit. Positional number systems have a radix or a base. In the decimal system the radix is 10.

Characteristics of commonly used Number System

**Number Base Symbols used Example**

System

Binary 2 0,1 1011.11

Octal 8 0,1,2,3,4,5,6,7 3567.25

Decimal 10 0,1,2,3,4,5,6,7,8,9 3974.576

Hexa-decimal 16 0,1,2,3,4,5,6,7,8 3FA9.56

9,A,B,C,D,E,F

Base Or Radix:

The base or radix of a number system equals the number of digits it has. Decimal numbers have a base of 10 because digits 0 through 9 are used. Binary numbers have a base of 2 because only the digits 0 and 1 are used. A subscript attached to a number indicates the base of the number.

**Positional Notation And Weights:**

The decimal number system uses positional notation. Each digit position has a weight or value. For decimal number the weights are units, tens, hundreds, etc., The sum of all the digits multiplied by their weights gives the total amount.

Example:

**For Decimal Number:**

Number = (2342)10

2’s weight is 1000=103

3’s weight is 100=102

4’s weight is 10=101

2’s weight is 1=100

therefore 2342 = 2*1000 + 3*100 + 4*10 + 2*1

= 2000+300+40+2( In powers of 10 2*103 + 3*102 + 4*101+2*1)

**For Binary Number:**

Number = 101

1’s weight is 100=102

0’s weight is 10=101

1’s weight is 1=100

therefore 111 = 1*100 + 0*10 +1*1

=100+0+1

=101

**4. BINARY TO DECIMAL CONVERSION:**

To convert a binary number into decimal number, multiply each binary digit by its positional weight and add them.

To simplify the conversion, the following steps may be followed:

1) write the binary number

2) write the numbers (weights) 1,2,4,8,16 (20,21,22,23,24…) directly under each digit of the binary integer number starting from the digit next to binary point towards left.

3) Whenever zero appears in the given binary number, the corresponding weights written below the ‘0’s can be neglected and by adding the remaining weights the decimal equivalent is obtained.

## Example

## Conteger Integer Part to decimal equivalent:

Convert (10011)2 to decimal equivalent

Step 1 : 1 0 0 1 1

Step 2 : 16 8 4 2 1

Step 3 : 16 8 4 2 1

Step 4 : 16+2+1 = 19

(10011)2 = (19)10

**Converting Fractional part to decimal equivalent:**

Converting fraction to decimal is same as converting binary integer to decimal equivalent except that the weights of digit positions (1,2,4,8,16…..) are to be replaced with ½, ¼ ,1/8,1/16 (i.e 2-1,2-2,2-3,2-4 ) starting from the binary digit next to the decimal point towards right.

Convert (0.1011)2 to decimal equivalent

Step 1 : 1 0 1 1

Step 2 : 0.5 0.25 0.125 0.0625

Step 3 : 0.5 0.25 0.125 0.0625

Step 4 : 0.5 + 0.125 + 0.0625= 0.6875

(0.1011)2 = (0.6875)10

**4. DECIMAL-TO-BINARY CONVERSION:**

To convert decimal numbers to binary numbers double dabble method is followed. In this method divide the decimal number by 2, writing down the remainder after each division till we get the quotient zero. Then the remainders are written sequentially with the last remainder at the left most extreme and the first remainder at the right most extreme.

## Example:

## Conversion Of An Integer From Decimal To Binary

1.convert (17)10 to binary

2 / 17 /2 / 8 / 1

2 / 4 / 0

2 / 2 / 0

1 / 0

(17)10=(10001)2

**Conversion Of Fraction To A Binary**

The conversion of fraction to binary is same as conversion of integer to binary except that multiplication is used instead of division and integers are accumulated instead of remainders.

convert (0.6875)10 to binary

a) 0.6875 is multiplied by 2 to give an integer and a fraction.(1.3750)

b) The new fraction (0.3750) is multiplied by 2 to give a integer and a new fraction.(0.7500)

c) This process is repeated until the fraction becomes 0 or the number of digits have sufficient accuracy.

Integer / Fraction /#### Coefficient

0.6875 * 2 = / 1 / + / 0.3750 / a-1 =10.3750 * 2 = / 0 / + / 0.7500 / a-2 =0

0.7500 * 2 = / 1 / + / 0.5000 / a-3 =1

0.5000 * 2 = / 1 / + / 0.0000 / a-4 =1

Answer : (0.6875)=( 0.a-1 a-2 a-3 a-4 )2 = (0.1011)2

**5. OCTAL NUMBER SYSTEMS:**

Since binary numbers are long and cumbersome to represent directly it is customary to represent by a number system, which is closely related to binary. There are two types of such systems used namely Octal and Hexadecimal Systems. Though a number is referred by any of these systems it is stored only in equivalent binary digits. The reason for using these systems in the latest computers, is that it represents a number in a simple form.

**OCTAL NUMBER SYSTEM:**

In octal number system the base is 8 and the digits vary from 0 to 7. The position of a digit to the left carries a weightage in ascending powers of 8 similar to the binary system. It may be noted that one digit of Octal System is equivalent to 3 digits of the corresponding positions in a binary to represent the same value.

Conversion Of Decimal Number To Octal Number:

To convert the octal number to decimal, use octal dabble method similar to double dabble method of binary number system. Divide the number by 8 to obtain the quotient and remainder. Repeat the same process of dividing the number(quotient) >=1 and < 8 as the final remainder. The remainders in the reverse order form the octal number.

Example:

Conversion of decimal integer to octal:

convert (175)10 the decimal number to octal number

8 / 175 /8 / 21 / 7

2 / 5

Conversion of decimal fraction to octal:

The conversion of fraction to octal is same as conversion of integer to octal except that multiplication is used instead of division and integers are accumulated instead of remainders.

convert (0.23)10 to octal

1. 0.23 is multiplied by 8 to give an integer(1) and a fraction (0.84).

2. The new fraction 0.84 is multiplied by 8 to give a integer and a new fraction.

3. This process is repeated until the fraction becomes 0 or the number of digits have sufficient accuracy.

Integer / Fraction /#### Coefficient

0.23 * 8 = / 1 / + / 0.84 / a-1 =10.84 * 8 = / 6 / + / 0.72 / a-2 =6

0.72 * 8 = / 5 / + / 0.76 / a-3 =5

Answer : (0.23)=( 0.a-1 a-2 a-3 )8 = (0.165)10

Conversion Of Octal number To Decimal Equivalent:

To convert an octal number into decimal, multiply each octal digit by its weights and add the resulting products.

Example:

Convert (237.42)8 to decimal equivalent

(237.42) 8 = (2*82) + (3*81) + (7*80) + (4*8–1) + (2*8–2)

= 2*64 + 3* 8 + 7 + 4/8 + 2/64

= 128 + 24 + 7 + 0.5 + 0.0312

= (159.5312) 10

(237.42)8 = (159.5312)10

Conversion of Octal Number To Binary Equivalent:

The conversion from octal to binary number becomes simple since the base of octal number 8 is the third power of 2, the base of binary numbers. Here each octal digit if replaced by its 3 binary equivalent.

Example:

Conversion of an octal integer to binary equivalent

The binary equivalent for the (634)8 is converted directly as follows

1.The first digit 4 is equivalent to 100

2.The second digit 3 is equivalent to 011

3.The third digit 6 is equivalent to 110

Therefore (634)8 = (110 011 100)2

Conversion of an octal fraction to binary equivalent

The binary equivalent for the (34.56)8 is converted directly as follows

1.The first digit 3 is equivalent to 011

2.The second digit 4 is equivalent to 100

3.The third digit 5 is equivalent to 101

3.The fourth digit 6 is equivalent to 110

Therefore (34.56)8 = ( 011 100 . 101 110) = (011100.101110)2

Conversion of Binary To Octal Conversion:

Large binary numbers can be converted into octal by grouping the bits in three, stating at the binary point and then converting each group of three to its octal equivalent (0’s are added at each end, if necessary)

Example:

1.Convert the binary number (1011.01101)2 into octal

(1011.01101)2 = 001 011 . 011 010

= 1 3 . 3 2

Therefore the octal number of (1011.01101)2 is (13.32)8

2.Convert the binary number (10101011)2 into octal (adding zero’s at left end)

(1011.01101)2 = 010 101 . 011

= 2 5 . 3

Therefore the octal number of (10101011)2 is (253)8

Advantage of using octal over Binary:

1. Octal number system requires less circuit because octal number are easier to read, record and print then binary numbers.

2. Large decimal numbers are easily converted to binary if we first convert to octal and then to binary. The reason is that a direct decimal-to-binary conversion requires many division than a decimal to octal conversion.

6. HEXADECIMAL NUMBER SYSTEM:

The number system having 16 as its base or radix is known as the Hexa Decimal Number System. It has 16 digits, which are 0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, and F. It means that a hexadecimal number is a string consisting of 0 to 9 decimal digits and A to F alphabets. The alphabets A to F represents the decimal numbers 10 to 15 example (79BE) 16 is a hexadecimal number in which B stands for the digit 11 and E stands for 14.