Number Systems | What is a number system in a 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. 

The Number System in a computer 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×82 + 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 F. So, 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 the 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.

HEXADECIMALDECIMALOCTALBINARY
0000
1111
22210
33311
444100
555101
666110
777111
88101000
99111001
A10121010
B11131011
C12141100
D13151101
E14161110
F15171111

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

DecHexOctCharDescription
000^@Null (NUL)
111^AStart of heading (SOH)
222^BStart of text (STX)
333^CEnd of text (ETX)
444^DEnd of transmission (EOT)
555^EEnquiry (ENQ)
666^FAcknowledge (ACK)
777^GBell (BEL)
8810^HBackspace (BS)
9911^IHorizontal tab (HT)
100A12^JLine feed (LF)
110B13^KVertical tab (VT)
120C14^LNew page/form feed (FF)
130D15^MCarriage return (CR)
140E16^NShift out (SO)
150F17^OShift in (SI)
161020^PData link escape (DLE)
171121^QDevice control 1 (DC1)
181222^RDevice control 2 (DC2)
191323^SDevice control 3 (DC3)
201424^TDevice control 4 (DC4)
211525^UNegative acknowledge (NAK)
221626^VSynchronous idle (SYN)
231727^WEnd of transmission block (ETB)
241830^XCancel (CAN)
251931^YEnd of medium (EM)
261A32^ZSubstitute (SUB)
271B33^[Escape (ESC)
281C34^File separator (FS)
291D35^]Group separator (GS)
301E36^^Record separator (RS)
311F37^_Unit separator (US)
322040 Space
332141!Exclamation mark
342242Quotation mark/Double quote
352343#Number sign
362444$Dollar sign
372545%Percent sign
382646&Ampersand
392747Apostrophe/Single quote
402850(Left parenthesis
412951)Right parenthesis
422A52*Asterisk
432B53+Plus sign
442C54,Comma
452D55Hyphen/Minus
462E56.Full stop/Period
472F57/Solidus/Slash
4830600Digit zero
4931611Digit one
5032622Digit two
5133633Digit three
5234644Digit four
5335655Digit five
5436666Digit six
5537677Digit seven
5638708Digit eight
5739719Digit nine
583A72:Colon
593B73;Semicolon
603C74Less-than sign
613D75=Equal/Equality sign
623E76Greater-than sign
633F77?Question mark
6440100@Commercial at/At sign
6541101ALatin capital letter A
6642102BLatin capital letter B
6743103CLatin capital letter C
6844104DLatin capital letter D
6945105ELatin capital letter E
7046106FLatin capital letter F
7147107GLatin capital letter G
7248110HLatin capital letter H
7349111ILatin capital letter I
744A112JLatin capital letter J
754B113KLatin capital letter K
764C114LLatin capital letter L
774D115MLatin capital letter M
784E116NLatin capital letter N
794F117OLatin capital letter O
8050120PLatin capital letter P
8151121QLatin capital letter Q
8252122RLatin capital letter R
8353123SLatin capital letter S
8454124TLatin capital letter T
8555125ULatin capital letter U
8656126VLatin capital letter V
8757127WLatin capital letter W
8858130XLatin capital letter X
8959131YLatin capital letter Y
905A132ZLatin capital letter Z
915B133[Left square bracket
925C134Reverse solidus/Backslash
935D135]Right square bracket
945E136^Circumflex accent/Caret
955F137_Underscore/Low line
9660140`Grave accent
9761141aLatin small letter a
9862142bLatin small letter b
9963143cLatin small letter c
10064144dLatin small letter d
10165145eLatin small letter e
10266146fLatin small letter f
10367147gLatin small letter g
10468150hLatin small letter h
10569151iLatin small letter i
1066A152jLatin small letter j
1076B153kLatin small letter k
1086C154lLatin small letter l
1096D155mLatin small letter m
1106E156nLatin small letter n
1116F157oLatin small letter o
11270160pLatin small letter p
11371161qLatin small letter q
11472162rLatin small letter r
11573163sLatin small letter s
11674164tLatin small letter t
11775165uLatin small letter u
11876166vLatin small letter v
11977167wLatin small letter w
12078170xLatin small letter x
12179171yLatin small letter y
1227A172zLatin small letter z
1237B173{Left curly bracket
1247C174|Vertical line/Vertical bar
1257D175}Right curly bracket
1267E176~Tilde
1277F177DELDelete (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

DecHexOctCharDescription
12880200  
12981201  
13082202  
13183203  
13284204  
13385205  
13486206  
13587207  
13688210  
13789211  
1388A212  
1398B213  
1408C214  
1418D215  
1428E216  
1438F217  
14490220  
14591221  
14692222  
14793223  
14894224  
14995225  
15096226  
15197227  
15298230  
15399231  
1549A232  
1559B233  
1569C234  
1579D235  
1589E236  
1599F237  
160A0240 No-break space
161A1241¡Inverted exclamation mark
162A2242¢Cent sign
163A3243£Pound sign
164A4244¤Currency sign
165A5245¥Yen/Yuan sign
166A6246¦Broken bar
167A7247§Section sign
168A8250¨Diaeresis
169A9251©Copyright sign
170AA252ªFeminine ordinal indicator
171AB253«Left-pointing double angle quotation mark
172AC254¬Not sign
173AD255­Soft hyphen
174AE256®Registered trademark sign
175AF257¯Macron
176B0260°Degree sign
177B1261±Plus-minus sign
178B2262²Superscript two
179B3263³Superscript three
180B4264´Acute accent
181B5265µMicro sign (mu)
182B6266Pilcrow sign
183B7267·Middle dot
184B8270¸Cedilla
185B9271¹Superscript one
186BA272ºMasculine ordinal indicator
187BB273»Right-pointing double angle quotation mark
188BC274¼Vulgar fraction one quarter
189BD275½Vulgar fraction one half
190BE276¾Vulgar fraction three quarters
191BF277¿Inverted question mark
192C0300ÀLatin capital letter A with grave
193C1301ÁLatin capital letter A with acute
194C2302ÂLatin capital letter A with circumflex
195C3303ÃLatin capital letter A with tilde
196C4304ÄLatin capital letter A with diaeresis
197C5305ÅLatin capital letter A with ring above
198C6306ÆLatin capital letter AE
199C7307ÇLatin capital letter C with cedilla
200C8310ÈLatin capital letter E with grave
201C9311ÉLatin capital letter E with acute
202CA312ÊLatin capital letter E with circumflex
203CB313ËLatin capital letter E with diaeresis
204CC314ÌLatin capital letter I with grave
205CD315ÍLatin capital letter I with acute
206CE316ÎLatin capital letter I with circumflex
207CF317ÏLatin capital letter I with diaeresis
208D0320ÐLatin capital letter ETH
209D1321ÑLatin capital letter N with tilde
210D2322ÒLatin capital letter O with grave
211D3323ÓLatin capital letter O with acute
212D4324ÔLatin capital letter O with circumflex
213D5325ÕLatin capital letter O with tilde
214D6326ÖLatin capital letter O with diaeresis
215D7327×Multiplication sign
216D8330ØLatin capital letter O with stroke
217D9331ÙLatin capital letter U with grave
218DA332ÚLatin capital letter U with acute
219DB333ÛLatin capital letter U with circumflex
220DC334ÜLatin capital letter U with diaeresis
221DD335ÝLatin capital letter Y with acute
222DE336ÞLatin capital letter THORN
223DF337ßLatin small letter sharp s
224E0340àLatin small letter a with grave
225E1341áLatin small letter a with acute
226E2342âLatin small letter a with circumflex
227E3343ãLatin small letter a with tilde
228E4344äLatin small letter a with diaeresis
229E5345åLatin small letter a with ring above
230E6346æLatin small letter ae
231E7347çLatin small letter c with cedilla
232E8350èLatin small letter e with grave
233E9351éLatin small letter e with acute
234EA352êLatin small letter e with circumflex
235EB353ëLatin small letter e with diaeresis
236EC354ìLatin small letter i with grave
237ED355íLatin small letter i with acute
238EE356îLatin small letter i with circumflex
239EF357ïLatin small letter i with diaeresis
240F0360ðLatin small letter eth
241F1361ñLatin small letter n with tilde
242F2362òLatin small letter o with grave
243F3363óLatin small letter o with acute
244F4364ôLatin small letter o with circumflex
245F5365õLatin small letter o with tilde
246F6366öLatin small letter o with diaeresis
247F7367÷Division sign/Obelus
248F8370øLatin small letter o with stroke
249F9371ùLatin small letter u with grave
250FA372úLatin small letter u with acute
251FB373ûLatin small letter u with circumflex
252FC374üLatin small letter u with diaeresis
253FD375ýLatin small letter y with acute
254FE376þLatin small letter thorn
255FF377ÿLatin small letter y with diaeresis

2 thoughts on “Number Systems | What is a number system in a computer?”

Leave a Comment

Ads Blocker Image Powered by Code Help Pro
Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Please Reload After Disabling Ad\'s