Number Systems | What is number system in computer?

We all know that a computer or any other machine can communicate in machine language only. So how come you can type in any language and a computer give the output in human-readable format?

It means when we enter any data it's being converted into something which only computer/machine can understand and then the response from the computer is being converted into a human-readable format so that humans can interact with the computer.

In digital systems, instructions are given through electric signals; variation is done by varying the voltage of the signal. Having 10 different voltages to implement a decimal number system in digital equipment is difficult. So, many number systems that are easier to implement digitally have been developed. 

Number Systems | What is number system in computer?


The Number Systems used in computers are:

  • Binary number system
  • Octal number system
  • Decimal number system
  • Hexadecimal number system

Binary number system

It has only two digits '0' and '1' so its base is 2. 

In this number system, there are only two types of electronic pulses; absence of electronic pulse which represents '0'and presence of electronic pulse which represents '1'. Each digit is called a bit. 

A group of four bits (1101) is called a nibble and a group of eight bits (11001010) is called a byte. The position of each digit in a binary number represents a specific power of the base (2) of the number system.

The binary number system is also a positional value system, where each digit has a value expressed in powers of 2.

Binary Number System

In any binary number, the rightmost digit is called a least significant bit (LSB) and the leftmost digit is called the most significant bit (MSB).

MSB lsb

For example, 10011 represents in the following ways 

(1 X 24) + (0 X 23) + (0 X 22) + (1 X 21) + (1 X 20)

16 + 0 + 0 + 2 + 1

19

Computer memory is measured in terms of how many bits it can store. Here is a chart for memory capacity conversion.

  • 1 byte (B) = 8 bits
  • 1 Kilobytes (KB) = 1024 bytes
  • 1 Megabyte (MB) = 1024 KB
  • 1 Gigabyte (GB) = 1024 MB
  • 1 Terabyte (TB) = 1024 GB
  • 1 Exabyte (EB) = 1024 PB
  • 1 Zettabyte = 1024 EB
  • 1 Yottabyte (YB) = 1024 ZB

Octal number system

It has eight digits (0, 1, 2, 3, 4, 5, 6, 7) so its base is 8. Each digit in an octal number represents a specific power of its base (8). 

As there are only eight digits, three bits (23=8) of binary number system can convert any octal number into a binary number. This number system is also used to shorten long binary numbers. 

The three binary digits can be represented with a single octal digit.

The decimal equivalent of an octal number is the sum of the product of each digit with its positional value.

7268 = 7×8+ 2×81 + 6×80

= 448 + 16 + 6

= 47010

Decimal number system

The decimal number system has ten digits starting from 0-9 so its base is 10. 

The position of each digit in a decimal number represents a specific power of the base (10) of the number system. 

For example, let's say we have three numbers – 734, 971 and 207. The value of 7 in all three numbers is different−

  • In 7314, the value of 7 is 7 thousand or 7000 or 7 × 1000 or 7 × 103
  • In 9701, the value of 7 is 7 hundred or 700 or 7 × 100 or 7 × 102
  • In 2007, value 0f 7 is 7 units or 7 or 7 × 1 or 7 × 100

The weightage of each position can be represented as follows −

Decimal Number System

Hexadecimal number system

In this number system there are 16 digits that range from 0 to 9 and A to FSo, its base is 16. 

The A to F alphabets represents 10 to 15 decimal numbers. The position of each digit in a hexadecimal number represents a specific power of the base (16) of the number system. 

As there are only sixteen digits, four bits (24=16) of binary number system can convert any hexadecimal number into a binary number. 

It is also known as an alphanumeric number system as it uses both numeric digits and alphabets.

The decimal equivalent of any hexadecimal number is the sum of product of each digit with its positional value.

27FB16 = 2×163 + 7×162 + 15×161 + 10×160

= 8192 + 1792 + 240 +10

= 1023410

Number System Relationship

The following table depicts the relationship between decimal, binary, octal and hexadecimal number systems.

    

HEXADECIMAL

DECIMAL

OCTAL

BINARY

0

0

0

0

1

1

1

1

2

2

2

10

3

3

3

11

4

4

4

100

5

5

5

101

6

6

6

110

7

7

7

111

8

8

10

1000

9

9

11

1001

A

10

12

1010

B

11

13

1011

C

12

14

1100

D

13

15

1101

E

14

16

1110

F

15

17

1111


ASCII(American Standard Code for the Information Interchange)

Besides numerical data, the computer must be able to handle alphabets, punctuation marks, mathematical operators, special symbols, etc. that form the complete character set of the English language. The complete set of characters or symbols are called alphanumeric codes. The complete alphanumeric code typically includes −

  • 26 upper case letters
  • 26 lower case letters
  • 10 digits
  • 7 punctuation marks
  • 20 to 40 special characters

Now a computer understands only numeric values, whatever the number system used. So all characters must have a numeric equivalent called the alphanumeric code. The most widely used alphanumeric code is American Standard Code for Information Interchange (ASCII). ASCII is a 7-bit code that has 128 (27) possible codes.

Standard ASCII Characters

Dec

Hex

Oct

Char

Description

0

0

0

^@

Null (NUL)

1

1

1

^A

Start of heading (SOH)

2

2

2

^B

Start of text (STX)

3

3

3

^C

End of text (ETX)

4

4

4

^D

End of transmission (EOT)

5

5

5

^E

Enquiry (ENQ)

6

6

6

^F

Acknowledge (ACK)

7

7

7

^G

Bell (BEL)

8

8

10

^H

Backspace (BS)

9

9

11

^I

Horizontal tab (HT)

10

0A

12

^J

Line feed (LF)

11

0B

13

^K

Vertical tab (VT)

12

0C

14

^L

New page/form feed (FF)

13

0D

15

^M

Carriage return (CR)

14

0E

16

^N

Shift out (SO)

15

0F

17

^O

Shift in (SI)

16

10

20

^P

Data link escape (DLE)

17

11

21

^Q

Device control 1 (DC1)

18

12

22

^R

Device control 2 (DC2)

19

13

23

^S

Device control 3 (DC3)

20

14

24

^T

Device control 4 (DC4)

21

15

25

^U

Negative acknowledge (NAK)

22

16

26

^V

Synchronous idle (SYN)

23

17

27

^W

End of transmission block (ETB)

24

18

30

^X

Cancel (CAN)

25

19

31

^Y

End of medium (EM)

26

1A

32

^Z

Substitute (SUB)

27

1B

33

^[

Escape (ESC)

28

1C

34

^\

File separator (FS)

29

1D

35

^]

Group separator (GS)

30

1E

36

^^

Record separator (RS)

31

1F

37

^_

Unit separator (US)

32

20

40

 

Space

33

21

41

!

Exclamation mark

34

22

42

"

Quotation mark/Double quote

35

23

43

#

Number sign

36

24

44

$

Dollar sign

37

25

45

%

Percent sign

38

26

46

&

Ampersand

39

27

47

'

Apostrophe/Single quote

40

28

50

(

Left parenthesis

41

29

51

)

Right parenthesis

42

2A

52

*

Asterisk

43

2B

53

+

Plus sign

44

2C

54

,

Comma

45

2D

55

-

Hyphen/Minus

46

2E

56

.

Full stop/Period

47

2F

57

/

Solidus/Slash

48

30

60

0

Digit zero

49

31

61

1

Digit one

50

32

62

2

Digit two

51

33

63

3

Digit three

52

34

64

4

Digit four

53

35

65

5

Digit five

54

36

66

6

Digit six

55

37

67

7

Digit seven

56

38

70

8

Digit eight

57

39

71

9

Digit nine

58

3A

72

:

Colon

59

3B

73

;

Semicolon

60

3C

74

Less-than sign

61

3D

75

=

Equal/Equality sign

62

3E

76

Greater-than sign

63

3F

77

?

Question mark

64

40

100

@

Commercial at/At sign

65

41

101

A

Latin capital letter A

66

42

102

B

Latin capital letter B

67

43

103

C

Latin capital letter C

68

44

104

D

Latin capital letter D

69

45

105

E

Latin capital letter E

70

46

106

F

Latin capital letter F

71

47

107

G

Latin capital letter G

72

48

110

H

Latin capital letter H

73

49

111

I

Latin capital letter I

74

4A

112

J

Latin capital letter J

75

4B

113

K

Latin capital letter K

76

4C

114

L

Latin capital letter L

77

4D

115

M

Latin capital letter M

78

4E

116

N

Latin capital letter N

79

4F

117

O

Latin capital letter O

80

50

120

P

Latin capital letter P

81

51

121

Q

Latin capital letter Q

82

52

122

R

Latin capital letter R

83

53

123

S

Latin capital letter S

84

54

124

T

Latin capital letter T

85

55

125

U

Latin capital letter U

86

56

126

V

Latin capital letter V

87

57

127

W

Latin capital letter W

88

58

130

X

Latin capital letter X

89

59

131

Y

Latin capital letter Y

90

5A

132

Z

Latin capital letter Z

91

5B

133

[

Left square bracket

92

5C

134

\

Reverse solidus/Backslash

93

5D

135

]

Right square bracket

94

5E

136

^

Circumflex accent/Caret

95

5F

137

_

Underscore/Low line

96

60

140

`

Grave accent

97

61

141

a

Latin small letter a

98

62

142

b

Latin small letter b

99

63

143

c

Latin small letter c

100

64

144

d

Latin small letter d

101

65

145

e

Latin small letter e

102

66

146

f

Latin small letter f

103

67

147

g

Latin small letter g

104

68

150

h

Latin small letter h

105

69

151

i

Latin small letter i

106

6A

152

j

Latin small letter j

107

6B

153

k

Latin small letter k

108

6C

154

l

Latin small letter l

109

6D

155

m

Latin small letter m

110

6E

156

n

Latin small letter n

111

6F

157

o

Latin small letter o

112

70

160

p

Latin small letter p

113

71

161

q

Latin small letter q

114

72

162

r

Latin small letter r

115

73

163

s

Latin small letter s

116

74

164

t

Latin small letter t

117

75

165

u

Latin small letter u

118

76

166

v

Latin small letter v

119

77

167

w

Latin small letter w

120

78

170

x

Latin small letter x

121

79

171

y

Latin small letter y

122

7A

172

z

Latin small letter z

123

7B

173

{

Left curly bracket

124

7C

174

|

Vertical line/Vertical bar

125

7D

175

}

Right curly bracket

126

7E

176

~

Tilde

127

7F

177

DEL

Delete (DEL)

 

In the ASCII character set, the Decimal values 0 to 31, as well as the Decimal value 127, represent symbols that are non-printable or non-graphical characters. 

It is possible to generate these non-printable characters using a key sequence where ^ represents the control key on your keyboard. 

For example, you could generate a carriage return (Decimal value 13) by pressing the control key followed by the letter M on your keyboard (^M).

All other symbols in the character set can be printed or represented on the screen and they are known as graphical characters.

Extended ASCII Characters

Dec

Hex

Oct

Char

Description

128

80

200

 

 

129

81

201

 

 

130

82

202

 

 

131

83

203

 

 

132

84

204

 

 

133

85

205

 

 

134

86

206

 

 

135

87

207

 

 

136

88

210

 

 

137

89

211

 

 

138

8A

212

 

 

139

8B

213

 

 

140

8C

214

 

 

141

8D

215

 

 

142

8E

216

 

 

143

8F

217

 

 

144

90

220

 

 

145

91

221

 

 

146

92

222

 

 

147

93

223

 

 

148

94

224

 

 

149

95

225

 

 

150

96

226

 

 

151

97

227

 

 

152

98

230

 

 

153

99

231

 

 

154

9A

232

 

 

155

9B

233

 

 

156

9C

234

 

 

157

9D

235

 

 

158

9E

236

 

 

159

9F

237

 

 

160

A0

240

 

No-break space

161

A1

241

¡

Inverted exclamation mark

162

A2

242

¢

Cent sign

163

A3

243

£

Pound sign

164

A4

244

¤

Currency sign

165

A5

245

¥

Yen/Yuan sign

166

A6

246

¦

Broken bar

167

A7

247

§

Section sign

168

A8

250

¨

Diaeresis

169

A9

251

©

Copyright sign

170

AA

252

ª

Feminine ordinal indicator

171

AB

253

«

Left-pointing double angle quotation mark

172

AC

254

¬

Not sign

173

AD

255

­

Soft hyphen

174

AE

256

®

Registered trademark sign

175

AF

257

¯

Macron

176

B0

260

°

Degree sign

177

B1

261

±

Plus-minus sign

178

B2

262

²

Superscript two

179

B3

263

³

Superscript three

180

B4

264

´

Acute accent

181

B5

265

µ

Micro sign (mu)

182

B6

266

Pilcrow sign

183

B7

267

·

Middle dot

184

B8

270

¸

Cedilla

185

B9

271

¹

Superscript one

186

BA

272

º

Masculine ordinal indicator

187

BB

273

»

Right-pointing double angle quotation mark

188

BC

274

¼

Vulgar fraction one quarter

189

BD

275

½

Vulgar fraction one half

190

BE

276

¾

Vulgar fraction three quarters

191

BF

277

¿

Inverted question mark

192

C0

300

À

Latin capital letter A with grave

193

C1

301

Á

Latin capital letter A with acute

194

C2

302

Â

Latin capital letter A with circumflex

195

C3

303

Ã

Latin capital letter A with tilde

196

C4

304

Ä

Latin capital letter A with diaeresis

197

C5

305

Å

Latin capital letter A with ring above

198

C6

306

Æ

Latin capital letter AE

199

C7

307

Ç

Latin capital letter C with cedilla

200

C8

310

È

Latin capital letter E with grave

201

C9

311

É

Latin capital letter E with acute

202

CA

312

Ê

Latin capital letter E with circumflex

203

CB

313

Ë

Latin capital letter E with diaeresis

204

CC

314

Ì

Latin capital letter I with grave

205

CD

315

Í

Latin capital letter I with acute

206

CE

316

Î

Latin capital letter I with circumflex

207

CF

317

Ï

Latin capital letter I with diaeresis

208

D0

320

Ð

Latin capital letter ETH

209

D1

321

Ñ

Latin capital letter N with tilde

210

D2

322

Ò

Latin capital letter O with grave

211

D3

323

Ó

Latin capital letter O with acute

212

D4

324

Ô

Latin capital letter O with circumflex

213

D5

325

Õ

Latin capital letter O with tilde

214

D6

326

Ö

Latin capital letter O with diaeresis

215

D7

327

×

Multiplication sign

216

D8

330

Ø

Latin capital letter O with stroke

217

D9

331

Ù

Latin capital letter U with grave

218

DA

332

Ú

Latin capital letter U with acute

219

DB

333

Û

Latin capital letter U with circumflex

220

DC

334

Ü

Latin capital letter U with diaeresis

221

DD

335

Ý

Latin capital letter Y with acute

222

DE

336

Þ

Latin capital letter THORN

223

DF

337

ß

Latin small letter sharp s

224

E0

340

à

Latin small letter a with grave

225

E1

341

á

Latin small letter a with acute

226

E2

342

â

Latin small letter a with circumflex

227

E3

343

ã

Latin small letter a with tilde

228

E4

344

ä

Latin small letter a with diaeresis

229

E5

345

å

Latin small letter a with ring above

230

E6

346

æ

Latin small letter ae

231

E7

347

ç

Latin small letter c with cedilla

232

E8

350

è

Latin small letter e with grave

233

E9

351

é

Latin small letter e with acute

234

EA

352

ê

Latin small letter e with circumflex

235

EB

353

ë

Latin small letter e with diaeresis

236

EC

354

ì

Latin small letter i with grave

237

ED

355

í

Latin small letter i with acute

238

EE

356

î

Latin small letter i with circumflex

239

EF

357

ï

Latin small letter i with diaeresis

240

F0

360

ð

Latin small letter eth

241

F1

361

ñ

Latin small letter n with tilde

242

F2

362

ò

Latin small letter o with grave

243

F3

363

ó

Latin small letter o with acute

244

F4

364

ô

Latin small letter o with circumflex

245

F5

365

õ

Latin small letter o with tilde

246

F6

366

ö

Latin small letter o with diaeresis

247

F7

367

÷

Division sign/Obelus

248

F8

370

ø

Latin small letter o with stroke

249

F9

371

ù

Latin small letter u with grave

250

FA

372

ú

Latin small letter u with acute

251

FB

373

û

Latin small letter u with circumflex

252

FC

374

ü

Latin small letter u with diaeresis

253

FD

375

ý

Latin small letter y with acute

254

FE

376

þ

Latin small letter thorn

255

FF

377

ÿ

Latin small letter y with diaeresis


Post a Comment

0 Comments