Computer Architecture
Computer Architecture
Lecturer: S. Shifran
[email protected]
+94 768701466
Senior Software QA Engineer (Accel Digital - Australia)
B.Sc in IS & Master in IT ® - University of Colombo
Lesson 01 –
Introduction to Computer System.
Lesson 02 –
Data Representation and Internal Operations of the
Computer & Number Representation
Day Plan
Assessment Strategy
❏What is Information?
❏What is Data ? processed outcome of data. (it is derived from
data)
Data is a collection of facts Provide meaningful values to the receiver.
❏Numbers
❏ Timely - Information should be available
❏Words when required.
❏ Accuracy - Information should be
❏Measurements accurate.
❏ Completeness - Information should be
❏Observations complete.
❏Description of things
Examples for Data & Information
Qualitative vs. Quantitative Data
⚫Numeric
⚫0 1 2 … 9
⚫Alphabetic
⚫a b c …… z
⚫Special
⚫# @ % ( $ &
Basic Data Types: Numeric data
4 - Most
●Integer significant bit
●Real
○All numbers including everything between integers
○ 0.23, 0, 5½, -2.3,
Input Devices
1. Keyboard
2. Mouse
3. Touch screen
4. Joystick
5. Light pen
6. Digital Camera
7. Webcam
8. Closed Circuit TV (CCTV)
9. Flatbed Scanners
10. Barcode Reader
11. Magnetic Ink Character Reader - MICR
12. Optical Character Recognition - OCR
13. Optical Mark Recognition - OMR
14. Automated Teller Machine - ATM
15. Microphone
Output Devices
1. Monitor/ Screen
2. Multimedia Projector
3. Printers
4. Plotter
5. Speaker
How do we store data in a computer?
●8 Bits = 1 Byte
●1024 Bytes = 1KB
●1024 KB = 1 MB
●1024 MB = 1 GB
●1024 GB = 1 TB
How do we store data in a computer?
available is 2n
●If we have 32 BITs then we can have 4GB of Memory (232 = 4 GB)
Data Representation in Computers?
⚫How do computers represent data?
⚫Most computers are digital
⚫ Recognize only two discrete states: on or off
⚫ Computers are electronic devices powered by electricity, which has only
two states, on or off
16 6/17/2019
Data Representation in Computers
⚫Binary representation
⚫A number system that has just two unique digits, 0 and 1
⚫The two digits represent the two off and on states
17 6/17/2019
Data Representation in Computers
19
Data Representation in Computers
⚫ Extended ASCII
20 ⚫ This system is an 8-bit system and allows the system to store up to 256 different
characters
⚫ EBCDIC (Extended BCD Interchange Code)
⚫8 bit ASCII used in the IBM mainframe environment.
⚫ Invention of IBM.
Data Representation in Computers
22
Lesson 02 – Data Outline
Representation and ❏Ancient numerals
Internal Operations ❏Decimal Number system.
of the Computer &
❏Binary number system
Number Representation
❏Binary to Octal
Conversion
❏Decimal to Hexadecimal
Conversion
Some Ancient Numerals
Egyptian
3rd Century BC
Cretan
1200-1700BC
England’s “five-barred gate”
The Greek Numeral System
Roman Numerals
1 I 20 Now try these:
XX
2 II 25
XXV
3 III 29 XIX 1. XXXVI
4 IV 50 L
5 V 75 2. XL
LXXV
6 VI 100 C 3. XVII
10 X 500
D 4. DCCLVI
11 XI 1000 M
16 XVI 5. MCMLXIX
Introduction to the Number System
342
3 x 100 4 x 10 2x1
Decimal Number System(cont..)
The decimal Number System:
• uses base 10
• includes only the symbols 0 through 9
……………
Position x 5 4 3 2 1
…..
……………
Binary Value 1 1 1 1 1 1
…
Decimal ……………
2 x-1
24 23 22 21 20
Binary Number System (cont.)
● 1 0 0 1 1 0 1
● 26 25 24 23 22 21 20
Binary Number System(cont.)
• uses base 2
• includes only the digits 0 and 1
The weighted values for each position is as follows:
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
Octal number system
• The octal number system uses EIGHT symbols to
represent numbers. The 8 distinct symbols are,
• 01234567
• Uses base 8
• Includes only the symbols 0 through 7
85 84 83 82 81 80
32768 4096 512 64 8 1
Hexadecimal number system
●With ‘0’ having the lowest value and ‘F’ having the highest
value.
Example
The binary value 1011 represents:
1x23 + 0x22 + 1x21 + 1x20
=1x8 + 0x4 + 1x2 + 1x1
=8 + 0 + 2 + 1
=11 (base 10)
Converting from Binary to Decimal
●1 X 20 = 1
● 1 0 0 1 1 0 1 ●0 X 21 = 0
● 26 25 24 23 22 21 20 ●1 X 22 = 4
●1 X 23 = 8
●0 X 24 = 0
● 20 = 1 24 = 16
21 = 2 25 ●0 X 25 = 0
= 32 22 = 4 26 ●1 X 26 = 64
= 64 23 = 8 7710
Decimal to Binary (Repeated Division By 2)
1. Break the binary number into 3-bit sections from the LSB to the MSB.
2. Convert the 3-bit binary number to its octal equivalent.
1.Break the binary number into 4-bit sections from the LSB to the MSB.
2.Convert the 4-bit binary number to its Hexa equivalent.
0 0000 8 1000
1 0001 9 1001
2 0010 A 1010
3 0011 B 1011
4 0100 C 1100
5 0101 D 1101
6 0110 E 1110
7 0111 F 1111
Hexa to Binary Conversion
B 2
1011 0010
This yields the binary number 10110010 or 1011 0010 in our more
readable format.
Hexadecimal to Decimal Conversion
Using the value from the previous example, B216, we can obtain
the decimal value as follows: 1
16
61
B x 161 2 x 160 16
11 x 16 2 x 1 61
16
176 2 61
16
61 1
16
176 + 2 = 178 61 1
6
0 x 163 0 x 162 11 x 161 2 x 160
Conversion from hexadecimal to decimal
1 0 0 1 1 0 0 1
b7 b6 b5 b4 b3 b2 b1 b0
Most Significant Bit (MSB) Least Significant Bit
(LSB)
The Binary equivalent of the decimal number 205 is as follows and
the Most Significant Bit(MSB) and the Least Significant Bit
(LSB)can be defined as below :
1 1 0 0 1 1 0 1
MS
LSB
B
BCD - Binary Coded Decimal
A B S C(arry)
0 0 0 0
1 0 1 0
0 1 1 0
1 1 0 1
●101111012+1011102
●1110112+11102
●1111002+100002
60
●11100002+1002
Binary Subtraction
▪ 0-0=0
▪ 0 - 1 = 1 (with borrow)
▪ 1-0=1
▪ 1-1=0
• E.g.
* * * (borrow)
1 0 1 1 0 1
- 0 1 0 1 1 1
Binary Multiplication
• E.g.
1 0 1 1
x 1
0 1 0
0
0 0 0
+ 1 01 1
+ 0 0 00
+ 1 0 1 1
= 1 1 0 1 1 1 0
Binary Division
• E.g.
1 0 1
1 0 1 1 1 0 1 1
- 1 0 1
0 1 1
- 0 0 0
1 1 1
- 1 0 1