0% found this document useful (0 votes)
14 views

Computer Science Notes

o level computer science

Uploaded by

Shin Thant Min
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Computer Science Notes

o level computer science

Uploaded by

Shin Thant Min
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Number System

Hexadecimal Base 16 0123456789ABCDEF 20 1


21 2
[0 ~ 15] 22 4
0 – off 23 8
24 16
Binary 25 32
26 64
1 – on 27 128
28 256
29 512
What is a BIT? 210 1024
211 2048
- Binary digIT (means two) 1 and 0 are the only values.
212 4096

1 Byte = 8 bits
Denary Hexadecimal Binary
0 0 0000
1 bit 1 1 0001
16 × 1 16 2 2 0010
00110101
16 × 2 32 3 3 0011
byte (8-bits) 16 × 3 48 4 4 0100
16 × 4 64 5 5 0101
16 × 5 80 6 6 0110
16 × 6 96 7 7 0111
16 × 7 112 8 8 1000
16 × 8 128 9 9 1001
16 × 9 144 10 A 1010
16 × 10 160 11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
Logical Binary Shift
Left Shift

Left – Most Bit (MSB) Right – Most Bit (LSB)

0 0 0 1 1 0 0 0 24

0 0 1 1 0 0 0 0 48 (1 left shift)

0 1 1 0 0 0 0 0 96 (2 left shift)

1 1 0 0 0 0 0 0 129 (3 left shift) 1 left shift = × 2

2 left shifts = × 22

MSB – Most Significant Bit 3 left shifts = × 23

LSB – Least Significant Bit


Use of the hexadecimal system
Easier for humans to remember, copy and work with.

Has four uses:

 Error codes
 MAC addresses
 IPv6
 HTML color codes

Error codes – shown as hexadecimal values and these numbers refer to the location of the error.

MAC addresses – uniquely identifies a device on a network and it is made up of 48 bits which are shown as 6 groups.

NN – NN – NN – DD – DD – DD NN:NN:NN:DD:DD:DD

First half – Identity number of the manufacture

Second half – Serial number

Internet Protocol (IP) addresses – IPv4 is 32-bit and IPv6 is 128-bit

a8fb:7a88:fff0:0fff:3d21:2085:66fb:f0fa

HyperText Mark-up Language (HTML) color codes – often used to represents colors of text on the computer screen. All

Colors can be made up of different combinations of 3 primary color.

Character sets – ASCII code and Unicode


ASCII – American Standard Code for Information Interchange was set up in 1963.

The standard ASCII code character set consists of 7-bit codes. (0 to 127)

The extended ASCII code character set consists of 8-bit codes. (0 to 255)

ASCII code has disadvantages does not represent characters in non-Western languages.

Unicode – can represent all languages of the world and it was set up in 1991.

Unicode goals:

 Universal standard that covered all languages


 More efficient
 Uniform encoding
 Unambiguous encoding where each 16-bit and 32-bit value always represents the same character.
Representation of Sound
Sound is analogue.

Computers cannot work with analogue data so sound waves need to be sampled in order to be stored in a computer.

Sampling measuring the amplitude of the sound wave and this is done using an analogue to digital converter (ADC)

Sound

ADC Binary

Representation of (bitmap) Images


Bitmap images are made up of pixels (picture elements).

21 = 2 (which means 2 colors)

22 = 4 (which means 4 colors)

0 = Black

1 = White

The number of bits used to represent each color is called color depth.

Pixelated = ‘fuzzy’

Measurement of data storage


G – 109

M – 106

K – 103

T - 1012

1 KiB = 210 = 1024 ~ 1000 = 103 = 1KB

1 MiB = 220 = 1024 × 1024 = 1048576 ~ 1000000 = 106 = 1MB

ICE – International Electrotechnical Commission


Calculation of file size
The file size of an image is calculated as:

Image resolution (in pixels) × color depth (in bits)

The size of a mono sound file is calculated as:

sample rate (in Hz) × sample resolution (in bits) × length of sample (in seconds)

You might also like