Вы находитесь на странице: 1из 48

FCCS1003 Computer Studies

FCCS1003
Computer Studies
Week 2:
Coding Scheme and Number
System
FCCS1003 Computer Studies

Precomputers and Early Computers


 Precomputers
 Ancient civilizations had the desire to
count and compute
 Abacus was invented.
 Early computing device: Punch Card
Tabulating Machine and Sorter
FCCS1003 Computer Studies

Precomputers and Early Computers


 First-Generation Computers (1940 –
1956)
 Vacuum tubes – small lightbulb-size
electronic tubes with glowing filaments
 Tube failure average 7 minutes, took
more than 15 minutes to find and replace
tube.
 Required great deal of electricity and
generated lots of heat
 Eg: ENIAC : 1800 square feet, weight
more than 30 tons, perform 5000
FCCS1003 Computer Studies

Precomputers and Early Computers


FCCS1003 Computer Studies

Precomputers and Early Computers


FCCS1003 Computer Studies

Precomputers and Early Computers


FCCS1003 Computer Studies

Precomputers and Early Computers


FCCS1003 Computer Studies

Precomputers and Early Computers


FCCS1003 Computer Studies

Precomputers and Early Computers


 Second-Generation Computers (1956-
1963)
 From Vacuum Tubes to Transistors
 Transistor - a tiny electrically
operated switch, or gate, that can
alternate between “on” and “off”
many millions of times per second
 First transistor were 1/100 size of a

vacuum tube. No need to warm up,


less energy, faster, more reliable.
FCCS1003 Computer Studies

Precomputers and Early Computers

1940s vacuum tube


towering over 1950s
transistor
FCCS1003 Computer Studies
FCCS1003 Computer Studies

Precomputers and Early Computers


 Third-Generation Computers (1964-
1971)
 Integrated circuits: transistors were
miniaturized to fit into silicon chips
called semiconductors together with
wires.
 This drastically increased the speed and
efficiency of computers.
 Eg: memory card
FCCS1003 Computer Studies

Current Computers
 Fourth-Generation Computers (1971-
current)
 Microprocessor: thousands of integrated
circuits built onto a single silicon chip.
 The first microprocessor: Intel 4004 chip.
 Eg: home PC, laptop, PDA, mobile phones,
embedded computers, game console, etc.
FCCS1003 Computer Studies

Future Computers
 Fifth-Generation Computers (future)
 Based on Artificial Intelligence or AI.
 AI: ‘fake brain’
 How to train the computer to emulate
human brain
 Eg: ability to think, remember and
reason
 Watch i-Robot
Electronic Switches
 Non-mechanical devices in
computers that open and close
circuits
 Types of electronic switches:
 Vacuum tubes
 Transistors:
 Semiconductors
 Integrated circuits
Digital Data: Switches and Bits
 Electronic switches:
 Vacuum tubes
 Transistors
 Integrated circuits
 Binary number system:
 Representing numbers
 Representing letters and symbols
 ASCII
 Unicode
The System Unit
The Binary System: Using On/Off Electrical
States to Represent Data & Instructions
 The binary system
has only two digits
- 0 and 1
 Bit - binary digit
 Byte - group of 8
bits used to
represent one
character, digit, or
other value
Switches Representing Data
 The on/off state of a switch
represents one bit of data
 Bit (binary digit): OFF
ON
 On = 1
 Off = 0
OR = 1 bit
0 1
Representing Characters:
Character Codes
➼ Character codes translate numerical
data into characters readable by
humans
 American Standard Code for
Information Interchange (ASCII) – Eight
bits equals one character; used by
minicomputers and personal computers
 Extended Binary Coded Decimal

Interchange Code (EBCDIC) – Eight bits


equals one character; used by mainframe
ASCII =4
computers
0 0 1 1 0 1 0 0 =4
EBCDIC
1 1 1 1 0 1 0 0
FCCS1003 Computer Studies

Representing Characters:
Character Codes
 Unicode – Sixteen bits equals one
character; over 65,000 combinations;
used for foreign language symbols
The Binary Number System
 Number systems:
 Organized ways to Binary
represent numbersBase2 digits
10 0 and
1
10 digits 0 through 9
64 32 16
1000 8100 410 21 1
2x32 2x16 2x8 2x4 2x2 2x1
2x1
10x10 10x10 10x1
0

Base 10
1011001 = 89
5832
Bits
1000 bits = 1 kilobit (kb)
1,000,000 bits = 1 megabit (mb)
1,000,000,000 bits = 1 gigabit (gb)

➼ Kilobits per second (Kbps),


megabits per second (Mbps), and
gigabits per second (Gbps) are
terms that describe units of data
used in measuring data transfer
rates
 Example: 56 Kbps modem
Bytes
8 bits = 1 Byte
1000 Bytes = 1 Kilobyte (KB)
1,000,000 Bytes = 1 Megabyte (MB)
1,000,000,000 Bytes = 1 Gigabyte (GB)
1,000,000,000,000 Bytes = 1 Terabyte (TB)

➼ Kilobyte, megabyte, gigabyte,


and terabyte are terms that
describe large units of data used in
measuring data storage
Example: 20 GB hard drive
 Kilobyte 1000 bytes

 Megabyte 1,000,000 bytes


(one million)

 Gigabyte 1,000,000,000 bytes


(one billion)

 Terabyte 1 trillion bytes

 Petabyte 1 quadrillion bytes


Representing Letters and Symbols
 American Standard Code for
Information Interchange (ASCII):
 8 bits equal 1 byte
 256 different combinations
 1 byte equals an alphanumeric character
or symbol A
B
C
b
a
 Unicode: ON
 16 bitsequal
OFF1 byte
 65000 different combinations
 Used for all languages:
 English, Japanese, Chinese, etc.
The Binary System: Using On/Off Electrical
States to Represent Data & Instructions
l ASCII - the
binary code
most widely
used with
microcomputers
l EBCDIC - used
with large
computers
l Unicode - uses
two bytes for
each character
rather than one
ASCII Chart
The Parity Bit
 How does a computer know that
an error has occurred during data
transmission?
 Factors such as dust, electrical
disturbance, weather conditions, etc.,
can cause interference in a circuit
 Detection of error is accomplish by
use of a parity bit
A parity bit, also called a check bit, is an
extra bit attached to the end of a byte for
purposes of checking for accuracy
Parity schemes may be even parity or odd
parity.
FCCS1003 Computer Studies

Number System
Modern: based on positional
notation (place value)
 Decimal system: system of
positional notation based on
powers of 10.
 Binary system: system of
positional notation based powers
of 2
 Hexadecimal system: system of
positional notation based on
powers of 16

FCCS1003 Computer Studies

Positional Notation: Base 10


43 = 4 x 101 + 3 x 100
10’s place 1’s place

Place 101 100

Value 10 1

Evaluat 4 x 10 3 x1
e
Sum 40 3
FCCS1003 Computer Studies

Positional Notation: Base 10


527 = 5 x 102 + 2 x 101 + 7 x 100

100’s place 10’s place 1’s place

Place 102 101 100

Value 100 10 1

Evaluate 5 x 100 2 x 10 7 x1

Sum 500 20 7
FCCS1003 Computer Studies
Positional Notation: Hexadecimal
 6,70416 = 26,37210

4,096’s place 256’s place 16’s place 1’s place

Place 163 162 161 160

Value 4,096 256 16 1

Evaluate 6 x 4,096 7 x 256 0 x 16 4x1

Sum for
24,576 1,792 0 4
Base 10
FCCS1003 Computer Studies
Positional Notation: Octal decimal
 6,7048 = 3,52410

512’s place 64’s place 8’s place 1’s place

Place 83 82 81 80

Value 512 64 8 1

Evaluate 6 x 512 7 x 64 0x8 4x1

Sum for
3,072 448 0 4
Base 10
FCCS1003 Computer Studies

Positional Notation: Binary


1101 01102 = 21410

Place 27 26 25 24 23 22 21 20

Value 128 64 32 16 8 4 2 1

Evaluat 1x 1x 0x 1 0x 1x 1x 0x
e 128 64 32 x16 8 4 2 1
Sum for
128 64 0 16 0 4 2 0
Base 10
FCCS1003 Computer Studies

Converting from Base 10


 Powers Table

Power 8 7 6 5 4 3 2 1 0
Base

2 256 128 64 32 16 8 4 2 1

32,76
8 4,096 512 64 8 1
8

65,53 4,09
16 256 16 1
6 6
FCCS1003 Computer Studies

From Base 10 to Base 2


4210 = 1010102

Power
Base 6 5 4 3 2 1 0

2 64 32 16 8 4 2 1

1 0 1 0 1 0

Integer 42/32
10/16 10/8 2/4 2/2 0/1
=1 =0 =1 =0 =1 =0

Remainde 10 10 2 2 0 0
r
FCCS1003 Computer Studies

From Base 10 to Base 2


Base 42
10
2) 42 Remainde
Quotient r
2) ( 0 Least significant
2) 21
10 bit
(1
2) 5 (0
2) 2 (1
2) 1 (0
Base 2 101010
FCCS1003 Computer Studies

From Base 10 to Base 16


5,73510 = 166716

Power
Base 4 3 2 1 0

16 65,53 4,096 256 16 1

6
1 6 6 7

Integer 5,735 /4,096 1,639 / 256 103 /16


=1 =6 =6 7

Remainde 5,735 - 1,639 – 103 – 96


r 4,096 = 1,536 = 103 = 7
FCCS1003 Computer Studies

From Base 10 to Base 16


Base 10 5,735

16 ) 5,735 Remainde
Quotient16 ) r
358
( 7 Least significant
16 ) 22 (bit
6
16 ) 1 (6
16 ) 0 ( 1 Most significant bit

Base 16 1667
FCCS1003 Computer Studies

From Base 10 to Base 16


Base 10 8,039

16 ) 8,039 Remainde
Quotient r
16 ) 502
( 7 Least significant
16 ) 31 (bit
6
16 ) 1 ( 15
16 ) 0 ( 1 Most significant bit

Base 16 1F67
FCCS1003 Computer Studies

From Base 10 to Base 8


73510 = 13378
Power
Base 4 3 2 1 0

8 4096 512 64 8 1

1 3 3 7
Integer 735 /512 223 / 64 31 /8 =3 7
=1 =3
Remainde 735 - 512 223 –192 31-24 =
r = 223 = 31 7
FCCS1003 Computer Studies

From Base 10 to Base 8


Base 10 735

8) 735 Remainde
Quotient 8 ) r
91
( 7 Least significant
8) 11 (bit
3
8) 1 (3
0 ( 1 Most significant bit

Base 8 1337
FCCS1003 Computer Studies

From Base 16 to
Base 2 & Base 8

Base 16 1 F 6 7

Base 2 0001 1111 0110 0111

Base 8 0 001 111 1 01 10 0 111


So answer is              1               7         5                  4           78
                               (001=1)      (111=7) (101=5)          (100=4)  (111=7)
   
FCCS1003 Computer Studies

EXERCISES
A) Convert the following binary numbers to its
decimal equivalent:
■ 1101012
■ 11100112
■ 1010112
■ 11000112

B) Convert the following decimal numbers to


its binary equivalent:
viii) 100
ix) 16
x) 78
xi) 25
FCCS1003 Computer Studies

EXERCISES
C) Convert the following hexadecimals
to its decimal equivalent:
 3E7
16

 4A5C
16

 50
16

D) Convert the following to binary


form:
 B9E4
16
FCCS1003 Computer Studies

EXERCISES
E) Convert to hexadecimal form and
octal decimal form:
■ 11101101101100
2

■ 11100011111102
■ 1111102

F) Convert the following decimals to


hexadecimals and octal decimals:
vii) 967

viii) 2893

Вам также может понравиться