SlideShare a Scribd company logo
Computer Organization & Architecture 1
Introduction to Digital Computer
Chapter 1
BCA , Sem - II
• A Digital computer can be considered as a digital system that performs various computational tasks.
• The first electronic digital computer was developed in the late 1940s and was used primarily for numerical
computations.
• By convention, the digital computers use the binary number system, which has two digits: 0 and 1.
• A binary digit is called a bit.
• A computer system is subdivided into two functional entities: Hardware and Software.
• The hardware consists of all the electronic components and electromechanical devices that comprise the physical
entity of the device.
• The software of the computer consists of the instructions and data that the computer manipulates to perform
various data-processing tasks.
Digital Computers
2
Computer Organization & Architecture 3
• The Central Processing Unit (CPU) contains an
arithmetic and logic unit for manipulating
data, a number of registers for storing data,
and a control circuit for fetching and executing
instructions.
• The memory unit of a digital computer
contains storage for instructions and data.
• The Random Access Memory (RAM) for
real-time processing of the data.
• The Input-Output devices for generating inputs from the user and displaying the final results to the user.
• The Input-Output devices connected to the computer include the keyboard, mouse, terminals, magnetic disk drives,
and other communication devices.
Block Diagram of Computers
Control &
Arithmatic
Input device
Output Device
PM DM
CPU
Memory
A+B+C
(A+B) = D
D + C = E
Computer Organization & Architecture 4
• Data representation refers to the manner in which data is stored in the computer
• There are several different formats for data storage
• It is important for computer problem solvers to understand the basic formats
• since we have finite storage, it is possible to overflow a storage location by trying to store too large number.
• Most programming languages provide multiple data types, each providing different length storage for
variables.
• It is up to the programmer to choose the data type with a length that won’t overflow
• Knowing how numbers are represented in storage helps one to overcome this problem.
Computer Organization & Architecture 5
Data Representation
• Computers only deal with binary data (0s and 1s), hence all data manipulated by computers must be represented
in binary format.
• Information handled by a computer is classified as instruction and data.
• No matter whether binary number is data in a numeric or non-numeric form or integer, everything is internally
represented in Binary.
• It is up to the programmer to handle the interpretation of the binary pattern and this interpretation is called Data
Representation.
• These data representation schemes are all standardized by international organizations.
• Choice of Data representation to be used in a computer is decided by
1. The number types to be represented (integer, real, signed, unsigned, etc.)
2. Range of values likely to be represented (maximum and minimum to be represented)
3. If non-numeric i.e. character, character representation standard to be chosen. ASCII, EBCDIC,
4. The hardware support in terms of word width, instruction.
Computer Organization & Architecture 6
Data Representation in Computers
Computer Organization & Architecture 7
Data Representation in Computers
Computer Organization & Architecture 8
LSB : Least Significant Bit
MSB : Most Significant Bit
LSB
MSB
6 Bit
4 Bit
If any binary number is n bit then we can make 2n numbers
1 0 1 1
23 22 21 20
1 0 1 1 0 1
25 24 23 22 21 20
LSB
MSB
Computer Organization & Architecture 9
Fixed Point Number Representation
• Fixed point numbers are also known as whole numbers or Integers.
• Unsigned Integer : A positive number including zero can be represented in this format. All the allotted bits are
utilized in defining the number. So if one is using 8 bits to represent the unsigned integer, the range of values
that can be represented is "0" to "255". If 16 bits are used for representing then the range is "0 to 65535".
• Signed Integer : In this format negative numbers, zero, and positive numbers can be represented. A sign bit
indicates the magnitude direction as positive or negative.
• There are three possible representations for signed integer and these are :
✓ Sign Magnitude format,
✓ 1's Compliment format
✓ 2's Complement format.
Computer Organization & Architecture 10
Sign Magnitude format:
• Most Significant Bit (MSB) is reserved for indicating the direction of the magnitude (value).
• A "0" on MSB means a positive number and a "1" on MSB means a negative number.
• If n bits are used for representation, n-1 bits indicate the absolute value of the number.
• Examples for n=8:
0 010 1111 = + 47 Decimal (Positive number)
1 010 1111 = - 47 Decimal (Negative Number)
0111 1110 = +126 (Positive number)
1111 1110 = -126 (Negative Number)
0 000 0000 = + 0 (Positive Number)
1 000 0000 = - 0 (Negative Number)
Signed Integer
Computer Organization & Architecture 11
1’s Complement format:
• In this format too, MSB is reserved as the sign bit.
• But the difference is in representing the Magnitude part of the value for negative numbers .
• Magnitude is inversed and hence called 1’s Complement form.
• To calculate the 1’s complement of a binary number just “flip” each bit of the original binary number.
• The positive numbers are represented as it is in binary.
• Examples for n=8:
0 010 1111 = + 47 Decimal (Positive number)
1 101 0000 = - 47 Decimal (Negative Number)
0111 1110 = +126 (Positive number)
1000 0001 = -126 (Negative Number)
Signed Integer
1010 = A
0101 = A’ A
Sign Magnitude Format
A = 1 1111111 : negative no
A = 0 1111111 : positive no
1’s Complement Format
A = 1 0000000 : negative no
A = 0 1111111 : positive no
0 1001 ( 9)
1 0110 (-9)
Computer Organization & Architecture 12
Signed Integer
2’s Complement format:
starting value 00100100 = +36
step1: reverse the bits (1's complement) 11011011
step 2: add 1 to the value from step 1 + 1
sum = 2's complement representation 11011100 = -36
Converting a given binary number to its 2's complement form
2’s Compliment method is very useful in binary subtraction
Decimal 3 = 11
1’s Comp.= 00
+ 1
2’s Comp = 01
Computer Organization & Architecture 13
Binary Addition
A B SUM Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
A = 1101
B = 0101
S = 10010
1
A = 12
B = 39
51
CARRY 1 0 1
NUMBER A 1 1 0 1
NUMBER B 0 1 0 1
ANSWER 10 0 1 0
Computer Organization & Architecture 14
Binary Subtraction
A B Difference
A - B
Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
A = 1101
B = 0101
S = 1000
Borrow
NUMBER A 1 1 0 1
NUMBER B 0 1 0 1
ANSWER 1 0 0 0
A = 0101
B = 1101
S = 1 1000
Borrow
NUMBER A 0 1 0 1
NUMBER B 1 1 0 1
ANSWER 1 0 0 0
Computer Organization & Architecture 15
Subtraction using 2’s Compliment
A = 4 , B = 6 ( A – B )
A = 100
B = 110
Step 1 : To find 1’s comp. of B ( B’)
B’ = 001
Step 2 : to find 2’s comp. of B ( B’ + 1 )
B” = B’+1 = 001+1 = 010
Step 3 : Add 2’s comp. of B to number A
A-B = A + B” = 100+010 = 110
A = 110
B = 010
Step 1 : B’ = 101
Step 2 : B” = 101
+ 001
110
Step 3 : A+ B” = 110
+ 110
C = 100
C’ = 011
C” = 011+1 = 100
Ans= C = 100 = 4
Find 2’s Comp of Ans
C = 110
C’ = 001
C” = 010
Computer Organization & Architecture 16
Floating Point Number Representation
• Binary numbers can also be described in exponential form.
• The description of binary numbers in the exponential form is called floating-point representation.
• In floating point representation, the computer must be able to represent the numbers and can be operated on them in such a
way that the position of the binary point is variable and is automatically adjusted as computation proceeds, for the
accommodation of very large integers and very small fractions. In this case, the binary point is said to be the float, and the
numbers are called the floating point numbers.
• The floating-point representation breaks the number into two parts, the left-hand side is a signed, fixed-point number known
as a mantissa and the right-hand side of the number is known as the exponent.
• The floating-point values are also authorized with a sign; 0 denoting the positive value and 1 denoting the negative value.
• In general the floating point representation has three fields:
• Sign
• Significant digits ( Mentessa ) and
• Exponents
Computer Organization & Architecture 17
• Let us consider the number 1 1 1 1 0 1. 1 0 0 0 1 1 0 to be represent in the floating point format.
• To represent the number in floating point format, the first binary point is shifted to the right of the first bit and the number
is multiplied by the correct scaling factor to get the same value. The number is said to be in the normalized form.
• It is important to note that the base in the scaling factor is fixed 2.
• The string of the significant digits is commonly known as mantissa.
Floating Point Number Representation
Computer Organization & Architecture 18
Floating Point Number Representation
0 denoting the positive value
1 denoting the negative value.
0 denoting the positive value
1 denoting the negative value.
• Numbering systems are characterized by their base number.
• In general a numbering system with a base r will have r different digits (including the 0) in its number set.
These digits will range from 0 to r-1
• The most widely used numbering systems are listed in the table below:
Computer Organization & Architecture 19
Number Systems
Decimal Binary Octal Hexadecimal
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
Computer Organization & Architecture 20
Decimal Binary Octal Hexadecimal
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
16 10000 20 10
17 10001 21 11
Number Systems
• Each digit (bit) is either 1 or 0
• Each bit represents a power of 2
• Every binary number is a sum of powers of 2 1 1 1 1 1 1 1 1
27 26 25 24 23 22 21 20
LSB
Least
Significant Bit
MSB
Most
Significant Bit
Computer Organization & Architecture 21
Binary Number Systems
1 1 1 . 0 1
2221 20 . 2-1 2-2
Converting Binary to Decimal
• Weighted positional notation shows how to calculate the decimal value of each binary bit:
Decimal = (dn-1  2n-1) + (dn-2  2n-2) + ... + (d1  21) + (d0  20)
d = binary digit
• binary 10101001 = decimal 169:
(1  27) + (1  25) + (1  23) + (1  20) = 128+32+8+1=169 1 0 1 0 1 1 1 1
1 2 8 + 3 2 + 8 + 4 + 2 + 1 = 1 7 5
Computer Organization & Architecture 22
1 0 1 0 1 0 0 1
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
1 X 128 0 1X 32 0 1X 8 0 0 1X 1
128 0 32 0 8 0 0 1
Computer Organization & Architecture 23
1 1 1 1
2^3 2^2 2^1 2^0
Step 1 : Assign positional weight to every bit
Step 2 : multiply positional weights with bit value and add them
1 X 2^3 + 1 X 2^2 + 1X 2^1 + 1 X 2^0
= (1 X 8 ) + (1 X 4 ) + ( 1 X 2) + ( 1 x 1)
= 8 + 4 + 2 + 1
= 15
( 1111) 2 = ( 15 ) 10
10110011010
Computer Organization & Architecture 24
1 0 1 1 0 0 1 1 0 1 0
2^10 2^9 2^8 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
1024 512 256 128 64 32 16 8 4 2 1
1024 0 256 128 0 0 16 8 0 2 0
1024 + 256 +128 16 + 8+ 2 = 1434
• Repeatedly divide the decimal integer by 2. Each remainder is a binary digit in the translated value:
Computer Organization & Architecture
37 = 100101
stop when
quotient is zero
least significant bit
most significant bit
Converting Decimal to Binary
Centre for Distance and Online Education
Division Quotient Remainder
22/2 11 0
11/2 5 1
5/2 2 1
2/2 1 0
1/2 0 1
(22)10 = (10110)2
Computer Organization & Architecture 26
Converting Decimal to Binary
Read
remainder
from
bottom to
top
Centre for Distance and Online Education
Computer Organization & Architecture 27
Hexadecimal Number Systems
Decimal Hex
16 10
17 11
18 12
19 13
20 14
21 15
22 16
23 17
24 18
25 19
26 1A
Centre for Distance and Online Education
Computer Organization & Architecture
28
• Each hexadecimal digit corresponds to 4 binary bits.
• Example: Translate the binary integer 000101101010011110010100 to
hexadecimal
Converting binary to Hexadecimal
0011 0100 1010 1011 1001 1011
3 4 A B 9 B
Centre for Distance and Online Education
0001 0110 1010 0111 1001 0100
Computer Organization & Architecture 29
• Each Hexadecimal digit can be replaced by its 4-bit binary number to form the binary equivalent.
Converting Hexadecimal to Binary
Centre for Distance and Online Education
2F7A49
001011110111101001001001
Computer Organization & Architecture 30
• Multiply each digit by its corresponding power of 16:
Decimal = (d3  163) + (d2  162) + (d1  161) + (d0  160)
d = hexadecimal digit
• Examples:
• Hex 1234 H = (1  163) + (2  162) + (3  161) + (4  160) = Decimal 4,660
• Hex 3BA4 H = (3  163) + (11 * 162) + (10  161) + (4  160) = Decimal 15,268
Converting Hexadecimal to Decimal
Centre for Distance and Online Education
Computer Organization & Architecture 31
Digit 1 2 3 4
Positional Weight 16^3 16^2 16^1 16^0
Multiply 1 X 4096 2 X 256 3 X 16 4 X 1
Value 4096 512 48 4
Final answer 4096+512+48+4 = 4660
Decimal 422 = 1A6 hexadecimal
stop when
quotient is zero
least significant digit
most significant digit
• Repeatedly divide the decimal integer by 16.
• Each remainder is a hex digit in the translated value
Computer Organization & Architecture
32
Converting Decimal to Hexadecimal
Centre for Distance and Online Education
• Octal is base 8 counting system having digit
values 0 through 7
• The octal system groups three binary bits
together into one digit symbol.
Computer Organization & Architecture 33
Octal Number System
Decimal Octal
7 7
8 10
9 11
10 12
12 13
14 14
15 15
16 17
17 20
18 21 Centre for Distance and Online Education
Computer Organization & Architecture 34
The Process: Successive Division
• Divide the decimal number by 8; the remainder is the LSB of
the octal number .
• If the quotation is zero, the conversion is complete.
Otherwise repeat step (a) using the quotation as the decimal
number. The new remainder is the next most significant bit
of the octal number.
Example:
Convert the decimal number 9410 into its octal equivalent.
MSB
1
r
0
1
8
3
r
1
11
8
LSB
6
r
11
94
8

=
=

=
 9410 = 1368
Converting Decimal to Octal
Centre for Distance and Online Education
Computer Organization & Architecture 35
Example:
Convert the decimal number 18910 into its octal equivalent.
Solution:
MSB
2
r
0
2
8
7
r
2
23
8
LSB
5
r
23
189
8

=
=

=
 18910 = 2758
Example : Decimal to Octal
Centre for Distance and Online Education
Computer Organization & Architecture 36
The Process: Weighted Multiplication
• Multiply each bit of the Octal Number by its corresponding bit-weighting factor
(i.e., Bit 0→ 80 = 1 ; Bit 1→81 = 8 ; Bit 2→82 = 64 ; etc.).
• Sum up all of the products in step (a) to get the decimal number.
Example:
Convert the octal number 1368 into its decimal equivalent.
 136 8 = 9410
1 3 6
82 81 80
64 8 1
64 + 24 + 6 = 9410
Bit-Weighting
Factors
Converting Octal to Decimal
Centre for Distance and Online Education
Computer Organization & Architecture 37
Example:
Convert the octal number 1348 into its decimal equivalent.
 1348 = 9210
1 3 4
82 81 80
64 8 1
64 + 24 + 4 = 9210
Solution:
Example : Octal to Decimal
Centre for Distance and Online Education
Computer Organization & Architecture 38
Decimal Binary Octal Hexadecimal
0 00000 0 0
1 00001 1 1
2 00010 2 2
3 00011 3 3
4 00100 4 4
5 00101 5 5
6 00110 6 6
7 00111 7 7
8 01000 10 8
9 01001 11 9
Decimal Binary Octal Hexadecimal
10 01010 12 A
11 01011 13 B
12 01100 14 C
13 01101 15 D
14 01110 16 E
15 01111 17 F
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
Number System Table
Centre for Distance and Online Education
Computer Organization & Architecture 39
Convert Decimal number 19 into Binary, Octal & Hexadecimal
1) Decimal to Binary : divide by 2 : 10011
2) Decimal to Octal : divide by 8 : 23
3) Decimal to Hex : divide by 16 : 13
Division Quotient Reminder
19 /16 1 3
1/16 0 1
Computer Organization & Architecture 40
Successive
Division
Weighted
Multiplication
Octal8
0 1 2 3 4 5 6 7
Successive
Division
Hexadecimal16
0 1 2 3 4 5 6 7 8 9 A B C D E F
Weighted
Multiplication
Successive
Division
Weighted
Multiplication
Binary2
0 1
Decimal10
0 1 2 3 4 5 6 7 8 9
Converting To and From Decimal
Centre for Distance and Online Education
Computer Organization & Architecture 41
Review: Number System Conversion
Successive
Division
a) Divide the decimal number by 2; the remainder is the LSB of the binary number.
b) If the quotation is zero, the conversion is complete. Otherwise repeat step (a) using the quotation as the decimal number.
The new remainder is the next most significant bit of the binary number.
a) Multiply each bit of the binary number by its corresponding bit-weighting factor
(i.e., Bit-0→20=1; Bit-1→21=2; Bit-2→22=4; etc).
a) Sum up all of the products in step (a) to get the decimal number.
Weighted
Multiplication
Computer Organization & Architecture 42
Successive
Division
a) Divide the decimal number by N; the remainder is the LSB of the ANY BASE Number .
b) If the quotient is zero, the conversion is complete. Otherwise repeat step (a) using the quotient as the decimal number.
The new remainder is the next most significant bit of the ANY BASE number.
a) Multiply each bit of the ANY BASE number by its corresponding bit-weighting factor
(i.e., Bit 0 → N0; Bit 1→ N1; Bit 2→ N2 ).
a) Sum up all of the products in step (a) to get the decimal number.
Weighted
Multiplication
Review : Number System Conversions
Centre for Distance and Online Education
Computer Organization & Architecture 43
Binary Coded Decimal ( BCD Code )
• In this code each decimal digit is represented by a 4-bit binary number.
• BCD is a way to express each of the decimal digits with a binary code.
• In the BINARY, with four bits we can represent sixteen numbers (0000 to 1111).
• But in BCD code only first ten of these are used (0000 to 1001).
• The remaining six code combinations i.e. 1010 to 1111 are invalid in BCD.
Centre for Distance and Online Education
Computer Organization & Architecture 44
Decimal Binary BCD
0 0000 0000
1 0001 0001
2 0010 0010
3 0011 0011
4 0100 0100
5 0101 0101
6 0110 0110
7 0111 0111
8 1000 1000
9 1001 1001
10 1010 0001 0000
11 1011 0001 0001
12 1100 0001 0010
(326)10 = ( 001100100110 ) BCD
3 2 6
0011 0010 0110
Binary Coded Decimal ( BCD Code )
Centre for Distance and Online Education
(1457)10 = (0001010001010111) BCD
1 4 5 7
0001 0100 0101 0111
Computer Organization & Architecture 45
Advantages of BCD Codes :
• It is very similar to decimal system.
• We need to remember binary equivalent of decimal numbers 0 to 9 only.
Disadvantages of BCD Codes :
• The addition and subtraction of BCD have different rules.
• The BCD arithmetic is little more complicated.
• BCD needs more number of bits than binary to represent the decimal number. So BCD is less efficient than binary.
Binary Coded Decimal ( BCD Code )
Centre for Distance and Online Education
Alphanumeric Codes
• A binary digit or bit can represent only two symbols as it has only two states '0' or '1’.
• But this is not enough for communication between two computers because there we need many more symbols for
communication.
• These symbols are required to represent 26 alphabets with capital and small letters, numbers from 0 to 9, punctuation marks
and other symbols.
• The alphanumeric codes are the codes that represent numbers and alphabetic characters.
• Mostly such codes also represent other characters such as symbol and various instructions necessary for conveying
information.
• An alphanumeric code should at least represent 10 digits and 26 letters of alphabet i.e. total 36 items.
• The following alphanumeric codes are very commonly used for the data representation.
• American Standard Code for Information Interchange (ASCII).
• Extended Binary Coded Decimal Interchange Code (EBCDIC).
Computer Organization & Architecture 46
Centre for Distance and Online Education
Computer Organization & Architecture 47
❖ Examples:
 ASCII code for space character = 20 (hex) = 32 (decimal)
 ASCII code for ‘A' = 41 (hex) = 65 (decimal)
 ASCII code for 'a' = 61 (hex) = 97 (decimal)
ASCII Code: American Standard Code
for Information Interchange
A = 1000001 = 41 H
a = 1100001 = 61 H
H = 48 H = 1001000
Centre for Distance and Online Education
K = 4B H = 1001011
Computer Organization & Architecture 48
Column Row
B7 B6 B5 B4
B3 B2 B1
1 0 0 0
0 0 1
4
1
A ( ASCII ) = 1000001 = 41 H
a ( ASCII ) = 1100001 = 61 H
Centre for Distance and Online Education
ASCII Code: American Standard Code
for Information Interchange
Computer Organization & Architecture 49
• The first 32 characters of ASCII table are used for control
• Control character codes = 00 to 1F (hex)
• Examples of Control Characters
➢ Character 0 is the NULL character  used to terminate a string
➢ Character 9 is the Horizontal Tab (HT) character
➢ Character 0A (hex) = 10 (decimal) is the Line Feed (LF)
➢ Character 0D (hex) = 13 (decimal) is the Carriage Return (CR)
➢ The LF and CR characters are used together
➢ They advance the cursor to the beginning of next line
• One control character appears at end of ASCII table
• Character 7F (hex) is the Delete (DEL) character
ASCII Code: American Standard Code
for Information Interchange
Computer Organization & Architecture 50
• is an 8-bit binary code for numeric and alphanumeric characters.
• It was developed and used by IBM.
• It is a coding representation in which symbols, letters and numbers are presented in binary language.
EBCDIC Code : Extended Binary-coded
Decimal Interchange Code
Computer Organization & Architecture 51
Char EBCDIC HEX Char EBCDIC HEX Char EBCDIC HEX
A 1100 0001 C1 P 1101 0111 D7 4 1111 0100 F4
B 1100 0010 C2 Q 1101 1000 D8 5 1111 0101 F5
C 1100 0011 C3 R 1101 1001 D9 6 1111 0110 F6
D 1100 0100 C4 S 1110 0010 E2 7 1111 0111 F7
E 1100 0101 C5 T 1110 0011 E3 8 1111 1000 F8
F 1100 0110 C6 U 1110 0100 E4 9 1111 1001 F9
G 1100 0111 C7 V 1110 0101 E5 blank … …
H 1100 1000 C8 W 1110 0110 E6 . … …
I 1100 1001 C9 X 1110 0111 E7 ( … …
J 1101 0001 D1 Y 1110 1000 E8 + … …
K 1101 0010 D2 Z 1110 1001 E9 $ … …
L 1101 0011 D3 0 1111 0000 F0 * … …
M 1101 0100 D4 1 1111 0001 F1 ) … …
N 1101 0101 D5 2 1111 0010 F2 – … …
O 1101 0110 D6 3 1111 0011 F3 /
EBCDIC Code : Extended Binary-coded Decimal Interchange Code
Computer Organization & Architecture 52
Representation of Digital Signal
Computer Organization & Architecture 53
Representation of Digital Signal
Logic is defined as a statement which is true if some condition is satisfied and false if that condition is not satisfied
Logic 0 = Low = False
Logic 1 = High = True
• Circuit required to implement logic is called as LOGIC GATE
• Logic gate is an electronic circuit which has one or many inputs but only one output
• Output is defined by logical relation between the inputs
Output
Y
A
B
Logic Gate
+ V
Logic Gate
Computer Organization & Architecture 54
Classification of logic Gates
Computer Organization & Architecture 55
Unit 1 - Introduction to Digital Computer (computer organization.pdf
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1
A B Y = A + B
0 0 0
0 1 1
1 0 1
1 1 1
A Y = A
0 1
1 0
Truth Table
AND Gate
OR Gate
NOT Gate
Computer Organization & Architecture 57
NAND & NOR are
called as Universal
Gates
Derived Gates
Computer Organization & Architecture 58
Computer Organization & Architecture 59
A
A.B
B
A
B
A+B
A.B
A.B
A B Y = A.B
0 0 1
0 1 1
1 0 1
1 1 0
A B Y = A + B
0 0 1
0 1 0
1 0 0
1 1 0
A B Y = A + B
0 0 0
0 1 1
1 0 1
1 1 0
Truth Table
NAND Gate
NOR Gate
EXOR Gate
Computer Organization & Architecture 60
Exclusive OR Y = A + B Y = A B + A B
A
B
+V
A
B
A.B
A
B A . B
Y = A B + A B
EXOR : Exclusive OR Gate
Computer Organization & Architecture 61
Pin Layout
Computer Organization & Architecture 62
Computer Organization & Architecture 63
• Logic equation is the equation which defines logical relation between inputs and outputs.
• Assume logic expression is Y=AC+BC , here Y is result or output and A,B,C are called as literals or
variable which are inputs.
• Any logic expression can be expressed in either of two standard forms:
1. Sum of Product form (SOP)
2. Product of Sum form (POS)
• These two forms are suitable for reducing the given logic expression to its simplest form.
Logic Equation
Computer Organization & Architecture 64
1. Sum of Product form (SOP) :
Y = AB + BC + AC
Each individual product term in standard SOP form is called as minterm
2. Product of Sum form (POS) :
Y = (A+B) · (B+ C) · ( A+ C )
Each individual Sum term in standard POS form is called as Maxterm
The concept of minterm & Maxterm allow us to introduce a very convenient
short hand notation to express logic function.
Logic Equation
Computer Organization & Architecture 65
Computer Organization & Architecture 66
• Boolean Algebra is used to analyze and simplify the digital (logic) circuits.
• It uses only the binary numbers i.e. 0 and 1.
• It is also called as Binary Algebra or logical Algebra.
Boolean Algebra
Computer Organization & Architecture 67
• Variable used can have only two values.
• Binary 1 for HIGH and Binary 0 for LOW.
• Complement of a variable is represented by an overbar (-).
• Thus, complement of variable B is represented as B . Thus if B = 0 then B = 1 and B = 1 then B = 0.
• ORing of the variables is represented by a plus (+) sign between them.
• For example ORing of A, B, C is represented as A + B + C.
• Logical ANDing of the two or more variable is represented by writing a dot between them such as A.B.C.
• Sometime the dot may be omitted like ABC.
Rules In Boolean Algebra
Computer Organization & Architecture 68
Boolean Laws
▪ Commutative law :
Commutative law states that changing the sequence of the variables does not have any effect on the output of a logic circuit.
▪ Associative law :
This law states that the order in which the logic operations are performed is irrelevant as their effect is the same.
▪ Distributive law :
Distributive law states the following condition.
Computer Organization & Architecture 69
• AND law
These laws use the AND operation. Therefore they are called as AND laws.
• OR law
These laws use the OR operation. Therefore they are called as OR laws.
• INVERSION law
This law uses the NOT operation. The inversion law states that double inversion of a variable results in the original variable itself.
Boolean Laws
A A A
0 1 0
1 0 1
Computer Organization & Architecture 70
A B Y = A+B
0 0 0
0 1 1
1 0 1
1 1 1
Combinational Circuit
Present Present
Present
I/P
Present
0/P
Sequential Circuit
Present
I/P
Present
0/P
Past
Unit 1 - Introduction to Digital Computer (computer organization.pdf
Combinational Circuits
➢ Adder Circuit
➢ Subtractor Circuit
➢ Multiplexer
➢ De Multiplexer
➢ Encoder
➢ Decoder
Sequential Circuits
➢ Flip Flop
➢ Shift Register
➢ Counter
Combinational
Circuits Memory
Sequential
Circuits
Computer Organization & Architecture 72
Half Adder
A
B
SUM
CARRY
A B SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
SUM = (A’ . B) + (A. B’)
CARRY = A.B
EXOR
AND
Half Adder
Computer Organization & Architecture 73
+ 5V
A
B
Carry
Sum
7408
7486
1
2
3
3
1
2
330 Ω
330 Ω
A B SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Half Adder
Computer Organization & Architecture 74
Full Adder
A
B
SUM
CARRY
A B C SUM CARRY
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
C
SUM = ( A’B’C) +( A’BC’) + (AB’C’ ) + ( ABC ) = A + B + C
CARRY = ( A’BC ) + ( AB’C) + ( ABC’ ) + ( ABC) = AB + BC+ AC
Full Adder
Computer Organization & Architecture 75
A B C SUM CARRY
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 o 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Truth Table
SUM = ( A’B’C) +( A’BC’) + (AB’C’ ) + ( ABC ) = A + B + C
CARRY = ( A’BC ) + ( AB’C) + ( ABC’ ) + ( ABC) = AB + BC + AC
A
B
AB
AC
BC
Full Adder
Computer Organization & Architecture 76
SUM 1
SUM
Half Adder 1
A
B
Half Adder 2
SUM 1
C
CARRY 1
CARRY 2
OR GATE
CARRY
Full Adder
Computer Organization & Architecture 77
A+B+C
(A+B) + C
CY1 S1 + C
CY2 S2 = SUM
+
+ 5V
A
B
Carry
7408
7486
+ 5V
A
B
Sum
7408
7486
C
1
2
3
3
1
2
6
4
5
6
5
4
330 Ω
330 Ω
3
1
2
Full Adder
Computer Organization & Architecture 78
Gnd
A2 A1 A0 B0
B1
B2
B 3
FA FA FA HA
C0
C1
C2
Cout S3 S2 S1 S0
A3
FA
A3 A2 A1 A0
+ B3 B2 B1 B0
C2 C1 C0 x
S3 S2 S1 S0
4 Bit Parallel Adder
Computer Organization & Architecture 79
Computer Organization & Architecture 80
• NOR and NAND gates are the basic building blocks of a Flip flop.
• So two states of these logic gates are considered here.
A B Y = A + B
0 0 1
0 1 0
1 0 0
1 1 0
A B Y = A.B
0 0 1
0 1 1
1 0 1
1 1 0
If any one input for NOR gate is high then output is 0
If any one input for NANAD gate is low then output is 1
Flip Flops
Computer Organization & Architecture 81
• Three Basic types of Flip Flops
1. R-S Flip-flop
2. D-Flip-flop
3. JK Flip-flop
4. T Flip-flop
R S Q
0 0 No
change
No
change
0 1 1 0
1 0 0 1
1 1 1 1
Flip Flops
RESET = OUTPUT BECOMES 0
SET = OUTPUT BECOMES 1
0
1
RACE / FORBIDDEN
R S Q Q
0 0 No
change
No
change
0 1 1 0
1 0 0 1
1 1 0 0
RS flip flop using NOR
Computer Organization & Architecture 82
A B Y = A + B
0 0 1
0 1 0
1 0 0
1 1 0
Computer Organization & Architecture 83
R S Q
0 0 1 1
0 1 1 0
1 0 0 1
1 1 No change No change
RS flip flop using NAND
Computer Organization & Architecture 84
CLK R S Q Q
0 X
( Don’t care)
X
( Don’t care)
NC NC
1 0 0 NC NC
1 0 1 1 0
1 1 0 0 1
1 0 0 RACE RACE
Clocked RS flip flop
Computer Organization & Architecture 85
CLK R S Q Q
1 X
( Don’t care)
X
( Don’t care)
NC NC
1 0 0 NC NC
1 0 1 NC NC
1 1 0 NC NC
1 1 1 NC NC
0 0 0 NC NC
0 0 1 1 0
0 1 0 0 1
0 0 0 RACE RACE
Computer Organization & Architecture 86
Clocked D Flip-Flip
D CLK Q
X L LAST STATE
0 H 0
1 H 1
K
JK Flip flop
Computer Organization & Architecture 87
Computer Organization & Architecture 88
CLK Tn Qn+1
X 0 Qn
X Qn
1 Toggle
T Flip flop ( Toggle )
Computer Organization & Architecture 89
END OF CHAPTER

More Related Content

PPTX
Unit I-L1 - Basics of Digital Computer Organization and Architecture
PPT
Computer organiztion2
PPT
Chapter 02 Data Types
PDF
Module 2_Data representations.pdf
PPTX
Lecture 7 Data Representation (1).pptx for computer organization and architec...
PPT
DATA REPRESENTATIONS and Data codes and formats.ppt
PPT
An introduction to data_representation.ppt
PPT
DATA REPRESENTATION
Unit I-L1 - Basics of Digital Computer Organization and Architecture
Computer organiztion2
Chapter 02 Data Types
Module 2_Data representations.pdf
Lecture 7 Data Representation (1).pptx for computer organization and architec...
DATA REPRESENTATIONS and Data codes and formats.ppt
An introduction to data_representation.ppt
DATA REPRESENTATION

Similar to Unit 1 - Introduction to Digital Computer (computer organization.pdf (20)

PPTX
Data Representation
PDF
Data representation computer architecture
PPT
Data representation moris mano ch 03
PDF
Datarepresentation2
PPSX
Coa presentation1
PPT
digitalelectronics.ppt
PPTX
Chapter_Two.pptx data representation in computer
PPT
Counit2
PPTX
Lecture 1
PDF
Using only above uploaded document(its formulas and concepts) solve problem 2...
PDF
Binaty Arithmetic and Binary coding schemes
PDF
Number System
PPTX
Basics of digital electronics
PDF
form-3-computer studies summarized NOTES.pdf
PPT
Data representation _
PPT
Topic 1 Data Representation
PPT
Topic 1 Data Representation
PDF
NumberSystemsAnnotated.pdf
PDF
chapter one && two.pdf
Data Representation
Data representation computer architecture
Data representation moris mano ch 03
Datarepresentation2
Coa presentation1
digitalelectronics.ppt
Chapter_Two.pptx data representation in computer
Counit2
Lecture 1
Using only above uploaded document(its formulas and concepts) solve problem 2...
Binaty Arithmetic and Binary coding schemes
Number System
Basics of digital electronics
form-3-computer studies summarized NOTES.pdf
Data representation _
Topic 1 Data Representation
Topic 1 Data Representation
NumberSystemsAnnotated.pdf
chapter one && two.pdf
Ad

More from chibunnajoe31 (8)

PPTX
PPT Unit 4- Introduction to Big Data.pptx
PDF
C Programming I. Unit two for beginners.
PDF
Database Management System lecture note.
PDF
Database Management System Lecture Note.
PDF
Database management system lecture note.
PDF
Database Management system lecture note.
PDF
Unit 2 - Digital Component Macrooperations.pdf
PDF
Unit 3 - Computer Organization .pdf
PPT Unit 4- Introduction to Big Data.pptx
C Programming I. Unit two for beginners.
Database Management System lecture note.
Database Management System Lecture Note.
Database management system lecture note.
Database Management system lecture note.
Unit 2 - Digital Component Macrooperations.pdf
Unit 3 - Computer Organization .pdf
Ad

Recently uploaded (20)

PPTX
artificial intelligence overview of it and more
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPTX
innovation process that make everything different.pptx
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
Testing WebRTC applications at scale.pdf
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
Internet___Basics___Styled_ presentation
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PDF
The Internet -By the Numbers, Sri Lanka Edition
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
E -tech empowerment technologies PowerPoint
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PDF
Introduction to the IoT system, how the IoT system works
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
international classification of diseases ICD-10 review PPT.pptx
artificial intelligence overview of it and more
Power Point - Lesson 3_2.pptx grad school presentation
Tenda Login Guide: Access Your Router in 5 Easy Steps
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
innovation process that make everything different.pptx
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Testing WebRTC applications at scale.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Internet___Basics___Styled_ presentation
Introuction about ICD -10 and ICD-11 PPT.pptx
The Internet -By the Numbers, Sri Lanka Edition
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
WebRTC in SignalWire - troubleshooting media negotiation
E -tech empowerment technologies PowerPoint
SASE Traffic Flow - ZTNA Connector-1.pdf
Introduction to the IoT system, how the IoT system works
Sims 4 Historia para lo sims 4 para jugar
international classification of diseases ICD-10 review PPT.pptx

Unit 1 - Introduction to Digital Computer (computer organization.pdf

  • 1. Computer Organization & Architecture 1 Introduction to Digital Computer Chapter 1 BCA , Sem - II
  • 2. • A Digital computer can be considered as a digital system that performs various computational tasks. • The first electronic digital computer was developed in the late 1940s and was used primarily for numerical computations. • By convention, the digital computers use the binary number system, which has two digits: 0 and 1. • A binary digit is called a bit. • A computer system is subdivided into two functional entities: Hardware and Software. • The hardware consists of all the electronic components and electromechanical devices that comprise the physical entity of the device. • The software of the computer consists of the instructions and data that the computer manipulates to perform various data-processing tasks. Digital Computers 2
  • 3. Computer Organization & Architecture 3 • The Central Processing Unit (CPU) contains an arithmetic and logic unit for manipulating data, a number of registers for storing data, and a control circuit for fetching and executing instructions. • The memory unit of a digital computer contains storage for instructions and data. • The Random Access Memory (RAM) for real-time processing of the data. • The Input-Output devices for generating inputs from the user and displaying the final results to the user. • The Input-Output devices connected to the computer include the keyboard, mouse, terminals, magnetic disk drives, and other communication devices. Block Diagram of Computers Control & Arithmatic Input device Output Device PM DM CPU Memory A+B+C (A+B) = D D + C = E
  • 4. Computer Organization & Architecture 4
  • 5. • Data representation refers to the manner in which data is stored in the computer • There are several different formats for data storage • It is important for computer problem solvers to understand the basic formats • since we have finite storage, it is possible to overflow a storage location by trying to store too large number. • Most programming languages provide multiple data types, each providing different length storage for variables. • It is up to the programmer to choose the data type with a length that won’t overflow • Knowing how numbers are represented in storage helps one to overcome this problem. Computer Organization & Architecture 5 Data Representation
  • 6. • Computers only deal with binary data (0s and 1s), hence all data manipulated by computers must be represented in binary format. • Information handled by a computer is classified as instruction and data. • No matter whether binary number is data in a numeric or non-numeric form or integer, everything is internally represented in Binary. • It is up to the programmer to handle the interpretation of the binary pattern and this interpretation is called Data Representation. • These data representation schemes are all standardized by international organizations. • Choice of Data representation to be used in a computer is decided by 1. The number types to be represented (integer, real, signed, unsigned, etc.) 2. Range of values likely to be represented (maximum and minimum to be represented) 3. If non-numeric i.e. character, character representation standard to be chosen. ASCII, EBCDIC, 4. The hardware support in terms of word width, instruction. Computer Organization & Architecture 6 Data Representation in Computers
  • 7. Computer Organization & Architecture 7 Data Representation in Computers
  • 8. Computer Organization & Architecture 8 LSB : Least Significant Bit MSB : Most Significant Bit LSB MSB 6 Bit 4 Bit If any binary number is n bit then we can make 2n numbers 1 0 1 1 23 22 21 20 1 0 1 1 0 1 25 24 23 22 21 20 LSB MSB
  • 9. Computer Organization & Architecture 9 Fixed Point Number Representation • Fixed point numbers are also known as whole numbers or Integers. • Unsigned Integer : A positive number including zero can be represented in this format. All the allotted bits are utilized in defining the number. So if one is using 8 bits to represent the unsigned integer, the range of values that can be represented is "0" to "255". If 16 bits are used for representing then the range is "0 to 65535". • Signed Integer : In this format negative numbers, zero, and positive numbers can be represented. A sign bit indicates the magnitude direction as positive or negative. • There are three possible representations for signed integer and these are : ✓ Sign Magnitude format, ✓ 1's Compliment format ✓ 2's Complement format.
  • 10. Computer Organization & Architecture 10 Sign Magnitude format: • Most Significant Bit (MSB) is reserved for indicating the direction of the magnitude (value). • A "0" on MSB means a positive number and a "1" on MSB means a negative number. • If n bits are used for representation, n-1 bits indicate the absolute value of the number. • Examples for n=8: 0 010 1111 = + 47 Decimal (Positive number) 1 010 1111 = - 47 Decimal (Negative Number) 0111 1110 = +126 (Positive number) 1111 1110 = -126 (Negative Number) 0 000 0000 = + 0 (Positive Number) 1 000 0000 = - 0 (Negative Number) Signed Integer
  • 11. Computer Organization & Architecture 11 1’s Complement format: • In this format too, MSB is reserved as the sign bit. • But the difference is in representing the Magnitude part of the value for negative numbers . • Magnitude is inversed and hence called 1’s Complement form. • To calculate the 1’s complement of a binary number just “flip” each bit of the original binary number. • The positive numbers are represented as it is in binary. • Examples for n=8: 0 010 1111 = + 47 Decimal (Positive number) 1 101 0000 = - 47 Decimal (Negative Number) 0111 1110 = +126 (Positive number) 1000 0001 = -126 (Negative Number) Signed Integer 1010 = A 0101 = A’ A Sign Magnitude Format A = 1 1111111 : negative no A = 0 1111111 : positive no 1’s Complement Format A = 1 0000000 : negative no A = 0 1111111 : positive no 0 1001 ( 9) 1 0110 (-9)
  • 12. Computer Organization & Architecture 12 Signed Integer 2’s Complement format: starting value 00100100 = +36 step1: reverse the bits (1's complement) 11011011 step 2: add 1 to the value from step 1 + 1 sum = 2's complement representation 11011100 = -36 Converting a given binary number to its 2's complement form 2’s Compliment method is very useful in binary subtraction Decimal 3 = 11 1’s Comp.= 00 + 1 2’s Comp = 01
  • 13. Computer Organization & Architecture 13 Binary Addition A B SUM Carry 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 A = 1101 B = 0101 S = 10010 1 A = 12 B = 39 51 CARRY 1 0 1 NUMBER A 1 1 0 1 NUMBER B 0 1 0 1 ANSWER 10 0 1 0
  • 14. Computer Organization & Architecture 14 Binary Subtraction A B Difference A - B Borrow 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 0 A = 1101 B = 0101 S = 1000 Borrow NUMBER A 1 1 0 1 NUMBER B 0 1 0 1 ANSWER 1 0 0 0 A = 0101 B = 1101 S = 1 1000 Borrow NUMBER A 0 1 0 1 NUMBER B 1 1 0 1 ANSWER 1 0 0 0
  • 15. Computer Organization & Architecture 15 Subtraction using 2’s Compliment A = 4 , B = 6 ( A – B ) A = 100 B = 110 Step 1 : To find 1’s comp. of B ( B’) B’ = 001 Step 2 : to find 2’s comp. of B ( B’ + 1 ) B” = B’+1 = 001+1 = 010 Step 3 : Add 2’s comp. of B to number A A-B = A + B” = 100+010 = 110 A = 110 B = 010 Step 1 : B’ = 101 Step 2 : B” = 101 + 001 110 Step 3 : A+ B” = 110 + 110 C = 100 C’ = 011 C” = 011+1 = 100 Ans= C = 100 = 4 Find 2’s Comp of Ans C = 110 C’ = 001 C” = 010
  • 16. Computer Organization & Architecture 16 Floating Point Number Representation • Binary numbers can also be described in exponential form. • The description of binary numbers in the exponential form is called floating-point representation. • In floating point representation, the computer must be able to represent the numbers and can be operated on them in such a way that the position of the binary point is variable and is automatically adjusted as computation proceeds, for the accommodation of very large integers and very small fractions. In this case, the binary point is said to be the float, and the numbers are called the floating point numbers. • The floating-point representation breaks the number into two parts, the left-hand side is a signed, fixed-point number known as a mantissa and the right-hand side of the number is known as the exponent. • The floating-point values are also authorized with a sign; 0 denoting the positive value and 1 denoting the negative value. • In general the floating point representation has three fields: • Sign • Significant digits ( Mentessa ) and • Exponents
  • 17. Computer Organization & Architecture 17 • Let us consider the number 1 1 1 1 0 1. 1 0 0 0 1 1 0 to be represent in the floating point format. • To represent the number in floating point format, the first binary point is shifted to the right of the first bit and the number is multiplied by the correct scaling factor to get the same value. The number is said to be in the normalized form. • It is important to note that the base in the scaling factor is fixed 2. • The string of the significant digits is commonly known as mantissa. Floating Point Number Representation
  • 18. Computer Organization & Architecture 18 Floating Point Number Representation 0 denoting the positive value 1 denoting the negative value. 0 denoting the positive value 1 denoting the negative value.
  • 19. • Numbering systems are characterized by their base number. • In general a numbering system with a base r will have r different digits (including the 0) in its number set. These digits will range from 0 to r-1 • The most widely used numbering systems are listed in the table below: Computer Organization & Architecture 19 Number Systems
  • 20. Decimal Binary Octal Hexadecimal 0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 8 1000 10 8 Computer Organization & Architecture 20 Decimal Binary Octal Hexadecimal 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F 16 10000 20 10 17 10001 21 11 Number Systems
  • 21. • Each digit (bit) is either 1 or 0 • Each bit represents a power of 2 • Every binary number is a sum of powers of 2 1 1 1 1 1 1 1 1 27 26 25 24 23 22 21 20 LSB Least Significant Bit MSB Most Significant Bit Computer Organization & Architecture 21 Binary Number Systems 1 1 1 . 0 1 2221 20 . 2-1 2-2
  • 22. Converting Binary to Decimal • Weighted positional notation shows how to calculate the decimal value of each binary bit: Decimal = (dn-1  2n-1) + (dn-2  2n-2) + ... + (d1  21) + (d0  20) d = binary digit • binary 10101001 = decimal 169: (1  27) + (1  25) + (1  23) + (1  20) = 128+32+8+1=169 1 0 1 0 1 1 1 1 1 2 8 + 3 2 + 8 + 4 + 2 + 1 = 1 7 5 Computer Organization & Architecture 22 1 0 1 0 1 0 0 1 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0 1 X 128 0 1X 32 0 1X 8 0 0 1X 1 128 0 32 0 8 0 0 1
  • 23. Computer Organization & Architecture 23 1 1 1 1 2^3 2^2 2^1 2^0 Step 1 : Assign positional weight to every bit Step 2 : multiply positional weights with bit value and add them 1 X 2^3 + 1 X 2^2 + 1X 2^1 + 1 X 2^0 = (1 X 8 ) + (1 X 4 ) + ( 1 X 2) + ( 1 x 1) = 8 + 4 + 2 + 1 = 15 ( 1111) 2 = ( 15 ) 10 10110011010
  • 24. Computer Organization & Architecture 24 1 0 1 1 0 0 1 1 0 1 0 2^10 2^9 2^8 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0 1024 512 256 128 64 32 16 8 4 2 1 1024 0 256 128 0 0 16 8 0 2 0 1024 + 256 +128 16 + 8+ 2 = 1434
  • 25. • Repeatedly divide the decimal integer by 2. Each remainder is a binary digit in the translated value: Computer Organization & Architecture 37 = 100101 stop when quotient is zero least significant bit most significant bit Converting Decimal to Binary Centre for Distance and Online Education
  • 26. Division Quotient Remainder 22/2 11 0 11/2 5 1 5/2 2 1 2/2 1 0 1/2 0 1 (22)10 = (10110)2 Computer Organization & Architecture 26 Converting Decimal to Binary Read remainder from bottom to top Centre for Distance and Online Education
  • 27. Computer Organization & Architecture 27 Hexadecimal Number Systems Decimal Hex 16 10 17 11 18 12 19 13 20 14 21 15 22 16 23 17 24 18 25 19 26 1A Centre for Distance and Online Education
  • 28. Computer Organization & Architecture 28 • Each hexadecimal digit corresponds to 4 binary bits. • Example: Translate the binary integer 000101101010011110010100 to hexadecimal Converting binary to Hexadecimal 0011 0100 1010 1011 1001 1011 3 4 A B 9 B Centre for Distance and Online Education 0001 0110 1010 0111 1001 0100
  • 29. Computer Organization & Architecture 29 • Each Hexadecimal digit can be replaced by its 4-bit binary number to form the binary equivalent. Converting Hexadecimal to Binary Centre for Distance and Online Education 2F7A49 001011110111101001001001
  • 30. Computer Organization & Architecture 30 • Multiply each digit by its corresponding power of 16: Decimal = (d3  163) + (d2  162) + (d1  161) + (d0  160) d = hexadecimal digit • Examples: • Hex 1234 H = (1  163) + (2  162) + (3  161) + (4  160) = Decimal 4,660 • Hex 3BA4 H = (3  163) + (11 * 162) + (10  161) + (4  160) = Decimal 15,268 Converting Hexadecimal to Decimal Centre for Distance and Online Education
  • 31. Computer Organization & Architecture 31 Digit 1 2 3 4 Positional Weight 16^3 16^2 16^1 16^0 Multiply 1 X 4096 2 X 256 3 X 16 4 X 1 Value 4096 512 48 4 Final answer 4096+512+48+4 = 4660
  • 32. Decimal 422 = 1A6 hexadecimal stop when quotient is zero least significant digit most significant digit • Repeatedly divide the decimal integer by 16. • Each remainder is a hex digit in the translated value Computer Organization & Architecture 32 Converting Decimal to Hexadecimal Centre for Distance and Online Education
  • 33. • Octal is base 8 counting system having digit values 0 through 7 • The octal system groups three binary bits together into one digit symbol. Computer Organization & Architecture 33 Octal Number System Decimal Octal 7 7 8 10 9 11 10 12 12 13 14 14 15 15 16 17 17 20 18 21 Centre for Distance and Online Education
  • 34. Computer Organization & Architecture 34 The Process: Successive Division • Divide the decimal number by 8; the remainder is the LSB of the octal number . • If the quotation is zero, the conversion is complete. Otherwise repeat step (a) using the quotation as the decimal number. The new remainder is the next most significant bit of the octal number. Example: Convert the decimal number 9410 into its octal equivalent. MSB 1 r 0 1 8 3 r 1 11 8 LSB 6 r 11 94 8  = =  =  9410 = 1368 Converting Decimal to Octal Centre for Distance and Online Education
  • 35. Computer Organization & Architecture 35 Example: Convert the decimal number 18910 into its octal equivalent. Solution: MSB 2 r 0 2 8 7 r 2 23 8 LSB 5 r 23 189 8  = =  =  18910 = 2758 Example : Decimal to Octal Centre for Distance and Online Education
  • 36. Computer Organization & Architecture 36 The Process: Weighted Multiplication • Multiply each bit of the Octal Number by its corresponding bit-weighting factor (i.e., Bit 0→ 80 = 1 ; Bit 1→81 = 8 ; Bit 2→82 = 64 ; etc.). • Sum up all of the products in step (a) to get the decimal number. Example: Convert the octal number 1368 into its decimal equivalent.  136 8 = 9410 1 3 6 82 81 80 64 8 1 64 + 24 + 6 = 9410 Bit-Weighting Factors Converting Octal to Decimal Centre for Distance and Online Education
  • 37. Computer Organization & Architecture 37 Example: Convert the octal number 1348 into its decimal equivalent.  1348 = 9210 1 3 4 82 81 80 64 8 1 64 + 24 + 4 = 9210 Solution: Example : Octal to Decimal Centre for Distance and Online Education
  • 38. Computer Organization & Architecture 38 Decimal Binary Octal Hexadecimal 0 00000 0 0 1 00001 1 1 2 00010 2 2 3 00011 3 3 4 00100 4 4 5 00101 5 5 6 00110 6 6 7 00111 7 7 8 01000 10 8 9 01001 11 9 Decimal Binary Octal Hexadecimal 10 01010 12 A 11 01011 13 B 12 01100 14 C 13 01101 15 D 14 01110 16 E 15 01111 17 F 16 10000 20 10 17 10001 21 11 18 10010 22 12 19 10011 23 13 Number System Table Centre for Distance and Online Education
  • 39. Computer Organization & Architecture 39 Convert Decimal number 19 into Binary, Octal & Hexadecimal 1) Decimal to Binary : divide by 2 : 10011 2) Decimal to Octal : divide by 8 : 23 3) Decimal to Hex : divide by 16 : 13 Division Quotient Reminder 19 /16 1 3 1/16 0 1
  • 40. Computer Organization & Architecture 40 Successive Division Weighted Multiplication Octal8 0 1 2 3 4 5 6 7 Successive Division Hexadecimal16 0 1 2 3 4 5 6 7 8 9 A B C D E F Weighted Multiplication Successive Division Weighted Multiplication Binary2 0 1 Decimal10 0 1 2 3 4 5 6 7 8 9 Converting To and From Decimal Centre for Distance and Online Education
  • 41. Computer Organization & Architecture 41 Review: Number System Conversion Successive Division a) Divide the decimal number by 2; the remainder is the LSB of the binary number. b) If the quotation is zero, the conversion is complete. Otherwise repeat step (a) using the quotation as the decimal number. The new remainder is the next most significant bit of the binary number. a) Multiply each bit of the binary number by its corresponding bit-weighting factor (i.e., Bit-0→20=1; Bit-1→21=2; Bit-2→22=4; etc). a) Sum up all of the products in step (a) to get the decimal number. Weighted Multiplication
  • 42. Computer Organization & Architecture 42 Successive Division a) Divide the decimal number by N; the remainder is the LSB of the ANY BASE Number . b) If the quotient is zero, the conversion is complete. Otherwise repeat step (a) using the quotient as the decimal number. The new remainder is the next most significant bit of the ANY BASE number. a) Multiply each bit of the ANY BASE number by its corresponding bit-weighting factor (i.e., Bit 0 → N0; Bit 1→ N1; Bit 2→ N2 ). a) Sum up all of the products in step (a) to get the decimal number. Weighted Multiplication Review : Number System Conversions Centre for Distance and Online Education
  • 43. Computer Organization & Architecture 43 Binary Coded Decimal ( BCD Code ) • In this code each decimal digit is represented by a 4-bit binary number. • BCD is a way to express each of the decimal digits with a binary code. • In the BINARY, with four bits we can represent sixteen numbers (0000 to 1111). • But in BCD code only first ten of these are used (0000 to 1001). • The remaining six code combinations i.e. 1010 to 1111 are invalid in BCD. Centre for Distance and Online Education
  • 44. Computer Organization & Architecture 44 Decimal Binary BCD 0 0000 0000 1 0001 0001 2 0010 0010 3 0011 0011 4 0100 0100 5 0101 0101 6 0110 0110 7 0111 0111 8 1000 1000 9 1001 1001 10 1010 0001 0000 11 1011 0001 0001 12 1100 0001 0010 (326)10 = ( 001100100110 ) BCD 3 2 6 0011 0010 0110 Binary Coded Decimal ( BCD Code ) Centre for Distance and Online Education (1457)10 = (0001010001010111) BCD 1 4 5 7 0001 0100 0101 0111
  • 45. Computer Organization & Architecture 45 Advantages of BCD Codes : • It is very similar to decimal system. • We need to remember binary equivalent of decimal numbers 0 to 9 only. Disadvantages of BCD Codes : • The addition and subtraction of BCD have different rules. • The BCD arithmetic is little more complicated. • BCD needs more number of bits than binary to represent the decimal number. So BCD is less efficient than binary. Binary Coded Decimal ( BCD Code ) Centre for Distance and Online Education
  • 46. Alphanumeric Codes • A binary digit or bit can represent only two symbols as it has only two states '0' or '1’. • But this is not enough for communication between two computers because there we need many more symbols for communication. • These symbols are required to represent 26 alphabets with capital and small letters, numbers from 0 to 9, punctuation marks and other symbols. • The alphanumeric codes are the codes that represent numbers and alphabetic characters. • Mostly such codes also represent other characters such as symbol and various instructions necessary for conveying information. • An alphanumeric code should at least represent 10 digits and 26 letters of alphabet i.e. total 36 items. • The following alphanumeric codes are very commonly used for the data representation. • American Standard Code for Information Interchange (ASCII). • Extended Binary Coded Decimal Interchange Code (EBCDIC). Computer Organization & Architecture 46 Centre for Distance and Online Education
  • 47. Computer Organization & Architecture 47 ❖ Examples:  ASCII code for space character = 20 (hex) = 32 (decimal)  ASCII code for ‘A' = 41 (hex) = 65 (decimal)  ASCII code for 'a' = 61 (hex) = 97 (decimal) ASCII Code: American Standard Code for Information Interchange A = 1000001 = 41 H a = 1100001 = 61 H H = 48 H = 1001000 Centre for Distance and Online Education K = 4B H = 1001011
  • 48. Computer Organization & Architecture 48 Column Row B7 B6 B5 B4 B3 B2 B1 1 0 0 0 0 0 1 4 1 A ( ASCII ) = 1000001 = 41 H a ( ASCII ) = 1100001 = 61 H Centre for Distance and Online Education ASCII Code: American Standard Code for Information Interchange
  • 49. Computer Organization & Architecture 49 • The first 32 characters of ASCII table are used for control • Control character codes = 00 to 1F (hex) • Examples of Control Characters ➢ Character 0 is the NULL character  used to terminate a string ➢ Character 9 is the Horizontal Tab (HT) character ➢ Character 0A (hex) = 10 (decimal) is the Line Feed (LF) ➢ Character 0D (hex) = 13 (decimal) is the Carriage Return (CR) ➢ The LF and CR characters are used together ➢ They advance the cursor to the beginning of next line • One control character appears at end of ASCII table • Character 7F (hex) is the Delete (DEL) character ASCII Code: American Standard Code for Information Interchange
  • 50. Computer Organization & Architecture 50 • is an 8-bit binary code for numeric and alphanumeric characters. • It was developed and used by IBM. • It is a coding representation in which symbols, letters and numbers are presented in binary language. EBCDIC Code : Extended Binary-coded Decimal Interchange Code
  • 51. Computer Organization & Architecture 51 Char EBCDIC HEX Char EBCDIC HEX Char EBCDIC HEX A 1100 0001 C1 P 1101 0111 D7 4 1111 0100 F4 B 1100 0010 C2 Q 1101 1000 D8 5 1111 0101 F5 C 1100 0011 C3 R 1101 1001 D9 6 1111 0110 F6 D 1100 0100 C4 S 1110 0010 E2 7 1111 0111 F7 E 1100 0101 C5 T 1110 0011 E3 8 1111 1000 F8 F 1100 0110 C6 U 1110 0100 E4 9 1111 1001 F9 G 1100 0111 C7 V 1110 0101 E5 blank … … H 1100 1000 C8 W 1110 0110 E6 . … … I 1100 1001 C9 X 1110 0111 E7 ( … … J 1101 0001 D1 Y 1110 1000 E8 + … … K 1101 0010 D2 Z 1110 1001 E9 $ … … L 1101 0011 D3 0 1111 0000 F0 * … … M 1101 0100 D4 1 1111 0001 F1 ) … … N 1101 0101 D5 2 1111 0010 F2 – … … O 1101 0110 D6 3 1111 0011 F3 / EBCDIC Code : Extended Binary-coded Decimal Interchange Code
  • 52. Computer Organization & Architecture 52 Representation of Digital Signal
  • 53. Computer Organization & Architecture 53 Representation of Digital Signal Logic is defined as a statement which is true if some condition is satisfied and false if that condition is not satisfied Logic 0 = Low = False Logic 1 = High = True
  • 54. • Circuit required to implement logic is called as LOGIC GATE • Logic gate is an electronic circuit which has one or many inputs but only one output • Output is defined by logical relation between the inputs Output Y A B Logic Gate + V Logic Gate Computer Organization & Architecture 54
  • 55. Classification of logic Gates Computer Organization & Architecture 55
  • 57. A B Y = A.B 0 0 0 0 1 0 1 0 0 1 1 1 A B Y = A + B 0 0 0 0 1 1 1 0 1 1 1 1 A Y = A 0 1 1 0 Truth Table AND Gate OR Gate NOT Gate Computer Organization & Architecture 57
  • 58. NAND & NOR are called as Universal Gates Derived Gates Computer Organization & Architecture 58
  • 59. Computer Organization & Architecture 59 A A.B B A B A+B A.B A.B
  • 60. A B Y = A.B 0 0 1 0 1 1 1 0 1 1 1 0 A B Y = A + B 0 0 1 0 1 0 1 0 0 1 1 0 A B Y = A + B 0 0 0 0 1 1 1 0 1 1 1 0 Truth Table NAND Gate NOR Gate EXOR Gate Computer Organization & Architecture 60
  • 61. Exclusive OR Y = A + B Y = A B + A B A B +V A B A.B A B A . B Y = A B + A B EXOR : Exclusive OR Gate Computer Organization & Architecture 61
  • 62. Pin Layout Computer Organization & Architecture 62
  • 63. Computer Organization & Architecture 63
  • 64. • Logic equation is the equation which defines logical relation between inputs and outputs. • Assume logic expression is Y=AC+BC , here Y is result or output and A,B,C are called as literals or variable which are inputs. • Any logic expression can be expressed in either of two standard forms: 1. Sum of Product form (SOP) 2. Product of Sum form (POS) • These two forms are suitable for reducing the given logic expression to its simplest form. Logic Equation Computer Organization & Architecture 64
  • 65. 1. Sum of Product form (SOP) : Y = AB + BC + AC Each individual product term in standard SOP form is called as minterm 2. Product of Sum form (POS) : Y = (A+B) · (B+ C) · ( A+ C ) Each individual Sum term in standard POS form is called as Maxterm The concept of minterm & Maxterm allow us to introduce a very convenient short hand notation to express logic function. Logic Equation Computer Organization & Architecture 65
  • 66. Computer Organization & Architecture 66 • Boolean Algebra is used to analyze and simplify the digital (logic) circuits. • It uses only the binary numbers i.e. 0 and 1. • It is also called as Binary Algebra or logical Algebra. Boolean Algebra
  • 67. Computer Organization & Architecture 67 • Variable used can have only two values. • Binary 1 for HIGH and Binary 0 for LOW. • Complement of a variable is represented by an overbar (-). • Thus, complement of variable B is represented as B . Thus if B = 0 then B = 1 and B = 1 then B = 0. • ORing of the variables is represented by a plus (+) sign between them. • For example ORing of A, B, C is represented as A + B + C. • Logical ANDing of the two or more variable is represented by writing a dot between them such as A.B.C. • Sometime the dot may be omitted like ABC. Rules In Boolean Algebra
  • 68. Computer Organization & Architecture 68 Boolean Laws ▪ Commutative law : Commutative law states that changing the sequence of the variables does not have any effect on the output of a logic circuit. ▪ Associative law : This law states that the order in which the logic operations are performed is irrelevant as their effect is the same. ▪ Distributive law : Distributive law states the following condition.
  • 69. Computer Organization & Architecture 69 • AND law These laws use the AND operation. Therefore they are called as AND laws. • OR law These laws use the OR operation. Therefore they are called as OR laws. • INVERSION law This law uses the NOT operation. The inversion law states that double inversion of a variable results in the original variable itself. Boolean Laws A A A 0 1 0 1 0 1
  • 70. Computer Organization & Architecture 70 A B Y = A+B 0 0 0 0 1 1 1 0 1 1 1 1 Combinational Circuit Present Present Present I/P Present 0/P Sequential Circuit Present I/P Present 0/P Past
  • 72. Combinational Circuits ➢ Adder Circuit ➢ Subtractor Circuit ➢ Multiplexer ➢ De Multiplexer ➢ Encoder ➢ Decoder Sequential Circuits ➢ Flip Flop ➢ Shift Register ➢ Counter Combinational Circuits Memory Sequential Circuits Computer Organization & Architecture 72
  • 73. Half Adder A B SUM CARRY A B SUM CARRY 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 SUM = (A’ . B) + (A. B’) CARRY = A.B EXOR AND Half Adder Computer Organization & Architecture 73
  • 74. + 5V A B Carry Sum 7408 7486 1 2 3 3 1 2 330 Ω 330 Ω A B SUM CARRY 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 Half Adder Computer Organization & Architecture 74
  • 75. Full Adder A B SUM CARRY A B C SUM CARRY 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 C SUM = ( A’B’C) +( A’BC’) + (AB’C’ ) + ( ABC ) = A + B + C CARRY = ( A’BC ) + ( AB’C) + ( ABC’ ) + ( ABC) = AB + BC+ AC Full Adder Computer Organization & Architecture 75
  • 76. A B C SUM CARRY 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 o 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Truth Table SUM = ( A’B’C) +( A’BC’) + (AB’C’ ) + ( ABC ) = A + B + C CARRY = ( A’BC ) + ( AB’C) + ( ABC’ ) + ( ABC) = AB + BC + AC A B AB AC BC Full Adder Computer Organization & Architecture 76
  • 77. SUM 1 SUM Half Adder 1 A B Half Adder 2 SUM 1 C CARRY 1 CARRY 2 OR GATE CARRY Full Adder Computer Organization & Architecture 77 A+B+C (A+B) + C CY1 S1 + C CY2 S2 = SUM +
  • 78. + 5V A B Carry 7408 7486 + 5V A B Sum 7408 7486 C 1 2 3 3 1 2 6 4 5 6 5 4 330 Ω 330 Ω 3 1 2 Full Adder Computer Organization & Architecture 78
  • 79. Gnd A2 A1 A0 B0 B1 B2 B 3 FA FA FA HA C0 C1 C2 Cout S3 S2 S1 S0 A3 FA A3 A2 A1 A0 + B3 B2 B1 B0 C2 C1 C0 x S3 S2 S1 S0 4 Bit Parallel Adder Computer Organization & Architecture 79
  • 80. Computer Organization & Architecture 80 • NOR and NAND gates are the basic building blocks of a Flip flop. • So two states of these logic gates are considered here. A B Y = A + B 0 0 1 0 1 0 1 0 0 1 1 0 A B Y = A.B 0 0 1 0 1 1 1 0 1 1 1 0 If any one input for NOR gate is high then output is 0 If any one input for NANAD gate is low then output is 1 Flip Flops
  • 81. Computer Organization & Architecture 81 • Three Basic types of Flip Flops 1. R-S Flip-flop 2. D-Flip-flop 3. JK Flip-flop 4. T Flip-flop R S Q 0 0 No change No change 0 1 1 0 1 0 0 1 1 1 1 1 Flip Flops RESET = OUTPUT BECOMES 0 SET = OUTPUT BECOMES 1 0 1 RACE / FORBIDDEN
  • 82. R S Q Q 0 0 No change No change 0 1 1 0 1 0 0 1 1 1 0 0 RS flip flop using NOR Computer Organization & Architecture 82 A B Y = A + B 0 0 1 0 1 0 1 0 0 1 1 0
  • 83. Computer Organization & Architecture 83 R S Q 0 0 1 1 0 1 1 0 1 0 0 1 1 1 No change No change RS flip flop using NAND
  • 84. Computer Organization & Architecture 84 CLK R S Q Q 0 X ( Don’t care) X ( Don’t care) NC NC 1 0 0 NC NC 1 0 1 1 0 1 1 0 0 1 1 0 0 RACE RACE Clocked RS flip flop
  • 85. Computer Organization & Architecture 85 CLK R S Q Q 1 X ( Don’t care) X ( Don’t care) NC NC 1 0 0 NC NC 1 0 1 NC NC 1 1 0 NC NC 1 1 1 NC NC 0 0 0 NC NC 0 0 1 1 0 0 1 0 0 1 0 0 0 RACE RACE
  • 86. Computer Organization & Architecture 86 Clocked D Flip-Flip D CLK Q X L LAST STATE 0 H 0 1 H 1
  • 87. K JK Flip flop Computer Organization & Architecture 87
  • 88. Computer Organization & Architecture 88 CLK Tn Qn+1 X 0 Qn X Qn 1 Toggle T Flip flop ( Toggle )
  • 89. Computer Organization & Architecture 89 END OF CHAPTER