$UNIT-1
$UNIT-1
D.SAMEERA
ASSISTANT PROFESSOR, M.TECH (CSE),(Ph.D.)
12+ YR EXP.
BVRIT, NARSAPUR
2
UNIT – 1
PART -1
BASIC STRUCTURE OF COMPUTERS
5
INTRODUCTION :
Ex : Embedded Systems
Digital computer :Fast electronic calculating machine .List of instructions processes and given
output.
Many types of computers exits that differ widely in size, cost, computational power, and intend
use.
1. Personal computer Ex: desktop
2. Notebook computers Ex: iPad
3. Workstations Ex: movie graphics , bhahubali
4. Enterprise systems Ex: Mainframes
5. Servers Ex: jntu server, all organization servers
6. Supercomputers Ex: whether forecasting, simulation, aircraft etc..
2 5
3 6
OUTPUT CONTROL
List of instructions is stored in memory, individual instructions are brought from the memory into
processor, execute the specified operations. EX: Tracking with F7 in C
Ex : ADD Loc A , R0
Register Operand
Instruction added at memory location
Finally places the sum in R0. [R0 = Value in address + R0 value]
Ex: LOAD Loc A , R1 [Load instruction of Loc A to R1]
ADD R1 , R0 [Adds the contents of registers R1 & R0,Places sum in R0]
The bits are transferred simultaneously over many wires , OR lines one Bit per line.
a group of Lines that serves as a connecting path for several devises is called a bus.
Is carries data, address and control purpose.
For Interconnecting functional units and it take one transfer at a time only 2 units can actively use the bus .
Single bus :structure low cost flexibility
Multiple buses : high cost it can Carry two or more transfer at same time .
In order for a user to enter and run an application program ,the computer must already contain some system software in
its memory.
A programmer using a high level language need not to know the details of machine program instructions .
a) Compiler: is system software program called compiler.
It Translate the high level language program into a suitable machine language programme containing instructions such as the ADD,
LOAD instructions
b) Text editor : entering and editing application programs
source program entering at a keyboard and stored in a file. (Simply a sequence of alpha numeric characters or binary data stored in
memory )
c) Operating system : is a large program collection of routines that is used to control the sharing of and interaction among
computer units As they execute application programs . Ex: Printer (Interrupt routine)
The most important measure of the performance of a computer is how quickly it in execute
programs .
For fetching instructions to getting results . The sum of this period As the processor time
needed to execute a program .
Main Cache
memory Processor
memory
It adds R1,R2 and stores results in R3. this processes is called Pipelining.
single Instruction executes in one clock cycle is Pipelining and multiple instructions executes in one clock
cycle is super Scalar execution/operation.
Super scalar :
I1 C1 1—C1-C3--1—C2---1—C3---1
I2 C2
I3 C1
Two instructions are executed at same clock cycle.
I4 C3
4. clock rate:
There are 2 possibilities to improve clock rate : 1. Improving Integrated circuits technology
2. reduce the amount of processing done or clock period.
Ex: Old days TV to LCD & LED.
FOURTH GENERATION:
Introduced large sections of the main memory of small computers could be implemented on single chip.
Very large scale integration [VLSI] (1000 ‘s of transistors could be placed)
MICROPROCESSOR
FIFTH GENERATION:
New features are added and introduced artificial intelligence, parallel mechanism, distributed systems.
UNIT – 1
PART -2
DATA REPRESENTATION
23
The term data refer to factual information used for analysis or reasoning.
Data itself has no meaning, becomes information when it is assigned a meaning.
The register stored information i.e. in different formats BITS,NUMBERS,& other binary coded information.
Data types found in registers of digital computers:
Numbers
Letters of the alphabet
Other discrete symbols
Binary coded form made up of flipflops means 0’s and 1’s.
The numeric system we use daily is the decimal system. But machine understands binary .
Ex : decimal 7 converted binary with 4 bit code is 0111. means decimal 1 digit is equal to binary 4
digits.
A base of a number system or radix defines the range of values that a digit may have.
In the binary system or base 2, there can be only two values for each digit of a number, either a "0"
or a "1".
In the octal system or base 8, there can be eight choices for each digit of a number:
"0", "1", "2", "3", "4", "5", "6", "7".
In the decimal system or base 10, there are ten different values for each digit of a number: "0", "1", "2",
"3", "4", "5", "6", "7", "8", "9".
In the hexadecimal system, we allow 16 values for each digit of a number: "0", "1", "2", "3", "4", "5", "6",
"7", "8", "9", "A", "B", "C", "D", "E", and "F".
Where “A” stands for 10, “B” for 11 and so on.
DECIMAL to DECIMAL:
The decimal no. system radix = 10. symbols are 0,1,2,3,4,5,6,7,8,9 , String = 724.5
Conversion (724.5)10 = 7*102+2*101+4*100+5*10-1 [NOTE : n…3 2 1 0 -1 -2 -3… -n ]
BINARY to DECIMAL: [NOTE : …Thousands Hundreds Tens Ones]
The binary no. system radix = 2 symbols are 0,1 , String of digits = 101101
Conversion (101101)2 = 1*25+0*24+1*23+1*22+0*21+1*20 = (45)10
OCTAL to DECIMAL:
The Octal no. system radix = 8 symbols are 0,1,2,3,4,5,6,7 , String = 736.4
Conversion (736.4)8 = 7*82+3*81+6*80+4*8-1 = (478.5)10
HEXA to DECIMAL:
The Octal no. system radix = 16 symbols are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F , String = F3
Conversion (F3)8 = F*161+3*160 = 15*16+3= (243)10
The decimal no. system radix = 10. symbols are 0,1,2,3,4,5,6,7,8,9 , String = 41.6875
In this string system is carried out by separating the number into 2 parts Integer & fraction .
(41.6875)10 Integer = 41 & fraction = 0.6875
Divisions by r Multiply by r 0.6875
2 |41 2
|20 | 1 (0.6875)10 = (1011)2
Note : a0,a1,a2…an from
______________________
|10 | 0 1.3750
|5 | 0 bottom to top 2
From top to bottom
|2 | 1
______________________
0.7500
|1 | 0
2
|0 |1 ______________________
1.0000
The conversions from and to binary ,octal & hexadecimal representation plays an important
part in digital computers.
Since, 23 =8, and 24 =16.,each octal digits correspondence to 3 binary digits.
Each hexadecimal digits correspondence to 4 binary digits.
Partition the binary number into groups of 3 bits.
OCT 1 2 7 5 4 3
Ex: DEC
BINARY 1 0 1 0 1 1 1 1 0 1 1 0 0 0 1 1
HEXA A F 6 3
!6-bit Register Can Be Used To Store Any Binary No. From 0 To 216-1.
D.SAMEERA, ASST.PROF,BVRIT 6/11/2018
BIN OCT HEX DEC
----------------------
Code for one octal digit means 7
0000 00 0 0 bits of octal = 1 digit of octal
0001 01 1 1
0010 02 2 2
0011 03 3 3
0100 04 4 4 Code for one hexadecimal digit
0101 05 5 5 means 15 bits of hexadecimal = 1
digit of hexadecimal
0110 06 6 6
Relationship between
0111 07 7 7
Binary - Octal and Binary-
----------------------
hexadecimal
001000 10 8 8
001001 11 9 9
001010 12 A 10
001011 13 B 11
001100 14 C 12
001101 15 D 13
001110 16 E 14
001111 17 F 15
D.SAMEERA, ASST.PROF,BVRIT 6/11/2018 32
BIN OCT HEX DEC
-----------------------------------------------------------
-
001 000 10 08 8
Relationship between Binary - 001 001 11 09 9
Octal and Binary-hexadecimal 010 100 24 14 20
001 100 011 143 63 99
F8
1 0 1 1 0 0 0 1 1 0 1 0 1 1 . 1 1 1 1
CONVERT BINARY
Alphanumeric Representation
Alphanumeric character set.
10 decimal digits, 26 letters, special character($, +, =,….)
Complements are used in digital computers for simplifying the subtraction operation and for
logical manipulation
or 101101 = 010010 [all 0’s becomes 1’s and 1’s become 0’s]
Ex: 1. 1011000 2. 0101101 26 =64 LCM (64) = 1000000
D.SAMEERA, ASST.PROF,BVRIT 6/11/2018
41
https://www.powtoon.com/s/cdZjT5Xr1o0/1/m
6/11/2018
D.SAMEERA, ASST.PROF,BVRIT
Subtraction of Unsigned Numbers
1) If M + (rn-N) (M=Minuend, N= Subtrahend) 44
2) If M N : Discard end carry, Result = M-N
3) If M N : No end carry, Result = - r’s complement of (N-M)
MN
[x-y means x+(2’s or 10’s complement of y)] MN
13250(M) - 72532(N) = -59282
Decimal Example)
13250
72532(M) - 13250(N) = 59282 No End Carry
+ 27468 (10’s complement of 72532)
72532 00 40718
Result = -(10’s complement of 40718)
Discard + 86750 (10’s complement of 13250)
End Carry = -(59281+1) = -59282
11 59282
Result = 59282
XY XY 1000011(X) - 1010100(Y) = -0010001
Binary Example)
1000011
1010100(X) - 1000011(Y) = 0010001 + 0101100 (2’s complement of 1010100)
1010100 0 1101111
Result = -(2’s complement of 1101111)
+ 0111101 (2’s complement of 1000011)
= -(0010000+1) = -0010001
1 0010001
Result = 0010001
2) Floating Point : the second register is used to designate the position of the binary point in the first register.
Integer Representation +14 -14
Signed-magnitude representation 0 0001110 1 0001110
Most Common
D.SAMEERA, ASST.PROF,BVRIT 6/11/2018
46
Arithmetic Addition :
Here take the 2’s complement of the subtrahend(N) (including sign bit) and add it to the Minuend(M)(Including the sign bit).
Subtraction is changed to an Addition
(± A) - (+ B) = (± A) + (- B) -6 11111010
(± A) - ( - B) = (± A) + (+ B) +13 0 0 0 0 1 1 0 1
----------------------------
Ex: (-6)-(-13) = +7 [ If we take 8 bit code] [Here –n means 2’s complement of (n)] +7 1 0 0 0 0 0 1 1 1
+6 = 00000110 -6 = 11111010 Discard end carry
+13 = 00001101 -13 = 11110011
The binary numbers in the 2’s complement system are added and subtracted by the same basic addition and subtraction
rules as unsigned numbers.
An overflow may occur if the two numbers added are both positive or both negative
When two unsigned numbers are added
* Overflow
an overflow is detected from the end carry out of the MSB position
+ve –ve +ve –ve
When two signed numbers are added carries 0 1 carries 1 0
+ 70 0 1000110 - 70 1 0111010
the MSB always represents the sign + 80 0 1010000 - 80 1 0110000
- the sign bit is treated as part of the number -------- ---------------- ------ ---------------
+ 150 1 0010110 - 150 0 1101010
- the end carry does not indicate an overflow
If these two carries are not equal, an overflow condition is produced(Exclusive-OR gate = 1)
Computers must represent everything with 1’s (-ve) and 0’s(+ve), including the sign of a number
and fixed/floating point number
2 ways to represent Numeric Data
1) Fixed Point
2) Floating Point
Binary/Decimal Point
The position of the binary/decimal point is needed to represent fractions, integers, or mixed integer-
fraction number
A 4 bit decimal code requires four F/Fs for each decimal digit
The representation of 4385 in BCD requires 16 F/Fs (0100 0011 1000 0101)
The representation in decimal is wasting a considerable amount of storage space and the circuits required to perform
decimal arithmetic are more complex
* (+375) + (-240)
375 + (10’s comp of 240)= 375 + 760
Many computers have direct decimal number in BCD for calculations ,if not it convert to binary BCD.
GRAY CODE:
This is a variable weighted code and is cyclic.
This means that it is arranged so that every transition from one value to the next value involves only one bit change. (Ex: K-Map)
The gray code is sometimes referred to as reflected binary. (mainly used for correcting errors in digital communications)
Binary number → Gray code
1 0 1 0 1 1 0 0 1 1 1 (binary number)
1 1 1 1 1 0 1 0 1 0 0 (gray code)
1 1 1 1 1 0 1 0 1 0 0 (gray code)
1 0 1 0 1 1 0 0 1 1 1 (binary number)
Decimal: 0 1 2 3 4 5 6 7 8 9
BCD: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
The position weights of the BCD code are 8, 4, 2, 1. Other codes (shown in the table) use position weights of 8, 4, -2, -1
and 2, 4, 2, 1.
EVEN PARITY
It is concept of detect errors. So transmitter knows noise is replacing
A single bit error is detected by it. Exampl Original signal PARITY any bit in original signal for making no.of
e BIT
1’s even in even parity/odd in odd parity.
1. 0 1 0 0 1
Receiver Transmitter Transmitter sends this signal like : 0 1 0 1
4-bit signal 2. 1 1 0 0 0 in place of 0 1 0 0.
ODD PARITY Receiver itself understand this and
There are 2 types of parity bits are Example Original signal PARITY identify noise .
there. BIT
EVEN PARITY 1. 0 1 0 0 0
Here 1 is noise.
ODD PARITY 2. 1 1 0 0 1 Because it
replaced 0.