Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
140 views26 pages

Numbering Systems, Decimal, Binary, Hexadecimal and ASCII: Position Notation

The document provides information about various numbering systems including decimal, binary, hexadecimal, and ASCII. It explains the concepts of positional notation and most/least significant bits. Decimal uses base-10, binary uses 0s and 1s, hexadecimal uses 0-9 and A-F to represent values. The ASCII table shows how to convert between decimal, hexadecimal, octal, binary encodings for various characters.

Uploaded by

kndnew guade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views26 pages

Numbering Systems, Decimal, Binary, Hexadecimal and ASCII: Position Notation

The document provides information about various numbering systems including decimal, binary, hexadecimal, and ASCII. It explains the concepts of positional notation and most/least significant bits. Decimal uses base-10, binary uses 0s and 1s, hexadecimal uses 0-9 and A-F to represent values. The ASCII table shows how to convert between decimal, hexadecimal, octal, binary encodings for various characters.

Uploaded by

kndnew guade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Numbering systems, Decimal, Binary,

Hexadecimal and ASCII


1. Last updated
Mar 30, 2022
2. Save as PDF
 
3.
Table of contents

1.
2.
3.
4.
5.
6.

A numbering system is a systematic way to represent numbers using a particular set of symbols.

Position Notation
All the numbering systems are positional systems. That's, the value of any symbol depends on its position in the number. E.g. the
value of 3 in the number 623 is that of three units, whereas its value in decimal 376 is that of three hundred.

Be aware that the powers increase from the right. The power of the rightmost digit is zero power, 100 (ones) of the next digit is
on, 101 (tens), and the power of the next digit is 102 (hundreds) and so on. These powers are also called the weight of the digit!

Therefore:

 The rightmost digit is called the LEAST SIGNIFICANT DIGIT/BIT = LSD/LSB


 The leftmost digit is called the MOST SIGNIFICANT DIGIT/BIT = MSD/MSB

Decimal (DEC)
The most commonly known system is the decimal system, based on the number 10, also known as the basis. The basis tells how many
different individual symbols are in the system to represent numbers.

In the decimal system these digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.


Binary (BIN)
The binary numbering system is based on the number 2, and it only has two symbols: 0 and 1 (Zero and One)

Either of these symbols can be called a binary digit or bit, as a bit is defined as a fundamental unit of information having just two
possible values, either 0 or 1.

An example of how to convert from binary to decimal can be seen below:

Hexadecimal (HEX)
The hexadecimal system has 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. 

Where A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.

The reason for choosing single letters to represent numbers higher than 9, is to keep individual symbols in single characters; a binary
number becomes to interpret when one digit represents more than one bit. in this case a HEX digit represents four bits, see example
below:
ASCII
We cannot directly read HEX even though it's much easier than reading binary! But we have been given some tools to help us read
these numbering systems, and one of them is called the ASCII table.
In the ASCII table, we can convert HEX into readable commands like if you take 4E 45 45 54 53 in HEX it spells NEETS in ASCII. 
ASCII, decimal, hexadecimal, octal, and binary conversion table

Last Updated: 2022-04-19

Helpful information for converting ASCII, decimal, hexadecimal, octal, and binary values can be referenced in this table.

ASCII Decimal Hexadecimal Octal Binary

null 0 0 0 0

start of 1 1 1 1
header

start of text 2 2 2 10

end of text 3 3 3 11

end of 4 4 4 100
transmission

enquire 5 5 5 101

acknowledg 6 6 6 110
e

bell 7 7 7 111

backspace 8 8 10 1000

horizontal 9 9 11 1001
tab

linefeed 10 A 12 1010

vertical tab 11 B 13 1011

form feed 12 C 14 1100

carriage 13 D 15 1101
return

shift out 14 E 16 1110

shift in 15 F 17 1111

data link 16 10 20 10000


escape

device 17 11 21 10001
control
1/Xon

device 18 12 22 10010
control 2

device 19 13 23 10011
control
3/Xoff

device 20 14 24 10100
control 4

negative 21 15 25 10101
acknowledg
e

synchronous 22 16 26 10110
idle

end of 23 17 27 10111
transmission
block

cancel 24 18 30 11000

end of 25 19 31 11001
medium

end of file/ 26 1A 32 11010


substitute

escape 27 1B 33 11011

file 28 1C 34 11100
separator

group 29 1D 35 11101
separator

record 30 1E 36 11110
separator

unit 31 1F 37 11111
separator

space 32 20 40 100000

! 33 21 41 100001

" 34 22 42 100010

# 35 23 43 100011
$ 36 24 44 100100

% 37 25 45 100101

& 38 26 46 100110

' 39 27 47 100111

( 40 28 50 101000

) 41 29 51 101001

* 42 2A 52 101010

+ 43 2B 53 101011

, 44 2C 54 101100

- 45 2D 55 101101

. 46 2E 56 101110

/ 47 2F 57 101111

0 48 30 60 110000

1 49 31 61 110001

2 50 32 62 110010

3 51 33 63 110011

4 52 34 64 110100

5 53 35 65 110101

6 54 36 66 110110

7 55 37 67 110111

8 56 38 70 111000

9 57 39 71 111001

: 58 3A 72 111010

; 59 3B 73 111011

< 60 3C 74 111100

= 61 3D 75 111101

> 62 3E 76 111110
? 63 3F 77 111111

@ 64 40 100 1000000

A 65 41 101 1000001

B 66 42 102 1000010

C 67 43 103 1000011

D 68 44 104 1000100

E 69 45 105 1000101

F 70 46 106 1000110

G 71 47 107 1000111

H 72 48 110 1001000

I 73 49 111 1001001

J 74 4A 112 1001010

K 75 4B 113 1001011

L 76 4C 114 1001100

M 77 4D 115 1001101

N 78 4E 116 1001110

O 79 4F 117 1001111

P 80 50 120 1010000

Q 81 51 121 1010001

R 82 52 122 1010010

S 83 53 123 1010011

T 84 54 124 1010100

U 85 55 125 1010101

V 86 56 126 1010110

W 87 57 127 1010111

X 88 58 130 1011000

Y 89 59 131 1011001

Z 90 5A 132 1011010
[ 91 5B 133 1011011

\ 92 5C 134 1011100

] 93 5D 135 1011101

^ 94 5E 136 1011110

_ 95 5F 137 1011111

` 96 60 140 1100000

a 97 61 141 1100001

b 98 62 142 1100010

c 99 63 143 1100011

d 100 64 144 1100100

e 101 65 145 1100101

f 102 66 146 1100110

g 103 67 147 1100111

h 104 68 150 1101000

i 105 69 151 1101001

j 106 6A 152 1101010

k 107 6B 153 1101011

l 108 6C 154 1101100

m 109 6D 155 1101101

n 110 6E 156 1101110

o 111 6F 157 1101111

p 112 70 160 1110000

q 113 71 161 1110001

r 114 72 162 1110010

s 115 73 163 1110011

t 116 74 164 1110100

u 117 75 165 1110101

v 118 76 166 1110110


w 119 77 167 1110111

x 120 78 170 1111000

y 121 79 171 1111001

z 122 7A 172 1111010

{ 123 7B 173 1111011

| 124 7C 174 1111100

} 125 7D 175 1111101

~ 126 7E 176 1111110

DEL 127 7F 177 1111111

  128 80 200 10000000

  129 81 201 10000001

  130 82 202 10000010

  131 83 203 10000011

  132 84 204 10000100

  133 85 205 10000101

  134 86 206 10000110

  135 87 207 10000111

  136 88 210 10001000

  137 89 211 10001001

  138 8A 212 10001010

  139 8B 213 10001011

  140 8C 214 10001100

  141 8D 215 10001101

  142 8E 216 10001110

  143 8F 217 10001111

  144 90 220 10010000

  145 91 221 10010001

  146 92 222 10010010


  147 93 223 10010011

  148 94 224 10010100

  149 95 225 10010101

  150 96 226 10010110

  151 97 227 10010111

  152 98 230 10011000

  153 99 231 10011001

  154 9A 232 10011010

  155 9B 233 10011011

  156 9C 234 10011100

  157 9D 235 10011101

  158 9E 236 10011110

  159 9F 237 10011111

  160 A0 240 10100000

  161 A1 241 10100001

  162 A2 242 10100010

  163 A3 243 10100011

  164 A4 244 10100100

  165 A5 245 10100101

  166 A6 246 10100110

  167 A7 247 10100111

  168 A8 250 10101000

  169 A9 251 10101001

  170 AA 252 10101010

  171 AB 253 10101011

  172 AC 254 10101100

  173 AD 255 10101101

  174 AE 256 10101110


  175 AF 257 10101111

  176 B0 260 10110000

  177 B1 261 10110001

  178 B2 262 10110010

  179 B3 263 10110011

  180 B4 264 10110100

  181 B5 265 10110101

  182 B6 266 10110110

  183 B7 267 10110111

  184 B8 270 10111000

  185 B9 271 10111001

  186 BA 272 10111010

  187 BB 273 10111011

  188 BC 274 10111100

  189 BD 275 10111101

  190 BE 276 10111110

  191 BF 277 10111111

  192 C0 300 11000000

  193 C1 301 11000001

  194 C2 302 11000010

  195 C3 303 11000011

  196 C4 304 11000100

  197 C5 305 11000101

  198 C6 306 11000110

  199 C7 307 11000111

  200 C8 310 11001000

  201 C9 311 11001001

  202 CA 312 11001010


  203 CB 313 11001011

  204 CC 314 11001100

  205 CD 315 11001101

  206 CE 316 11001110

  207 CF 317 11001111

  208 D0 320 11010000

  209 D1 321 11010001

  210 D2 322 11010010

  211 D3 323 11010011

  212 D4 324 11010100

  213 D5 325 11010101

  214 D6 326 11010110

  215 D7 327 11010111

  216 D8 330 11011000

  217 D9 331 11011001

  218 DA 332 11011010

  219 DB 333 11011011

  220 DC 334 11011100

  221 DD 335 11011101

  222 DE 336 11011110

  223 DF 337 11011111

  224 E0 340 11100000

  225 E1 341 11100001

  226 E2 342 11100010

  227 E3 343 11100011

  228 E4 344 11100100

  229 E5 345 11100101

  230 E6 346 11100110


  231 E7 347 11100111

  232 E8 350 11101000

  233 E9 351 11101001

  234 EA 352 11101010

  235 EB 353 11101011

  236 EC 354 11101100

  237 ED 355 11101101

  238 EE 356 11101110

  239 EF 357 11101111

  240 F0 360 11110000

  241 F1 361 11110001

  242 F2 362 11110010

  243 F3 363 11110011

  244 F4 364 11110100

  245 F5 365 11110101

  246 F6 366 11110110

  247 F7 367 11110111

  248 F8 370 11111000

  249 F9 371 11111001

  250 FA 372 11111010

  251 FB 373 11111011

  252 FC 374 11111100

  253 FD 375 11111101

  254 FE 376 11111110

  255 FF 377 11111111

Table 1. Conversions between ASCII, decimal, hexadecimal, octal, and binary


values
Binary Numbers and the Working of Computers
Udayan Shakya
Aug 14, 2020
|
9 min read

While possessing a vast knowledge of mathematics is not necessary to learn computer programming, it certainly
helps to have a basic grasp of some of the foundational mathematics that makes computing possible. And what
could be more fundamental to modern computing than binary mathematics?

The term 'binary' means something that has only two possible objects or states. In the binary number system,
these two objects are the numbers 0 and 1. These two numbers can represent a variety of things.
For example, in computer logic, 0 represents "false" while 1 represents "true". Or they could be used to represent
ordinary numbers as combinations of 1's and 0's. An example of this would be the representation of the numbers 0,
1, 2, 3, and 4 in three binary digits as 000, 001, 010, 011, and 100 respectively.
But what does this all mean at the fundamental level of computing? Why is the binary number system used as the
foundation for all of our computing?

Perhaps it would be easier to understand all of this if we can understand the basic working of computers at the
machine level.

0's and 1's: Interpreting the Workings of Computer Circuitry

computers operate on the electrical signals generated by these circuits. In order to design a computer that runs
efficiently, we need a system that can interpret electrical signals in a simplified and effective manner.

A good way of doing this is to interpret electrical signals as binary values: 0 for a low voltage value and 1 for a high
voltage value. An easier way of thinking about this is to imagine a light bulb. If the bulb is off, that state is
interpreted as having the value 0. If it is on, it is interpreted as having a value of 1.
Interpreting Bulb States in Binary
This broad generalization reduces the range of interpretation of each electric signal into two distinct values,
instead of an infinite range of continuous voltage values.
With this method of operating and interpreting electronic circuits in place, we can proceed to design coded
systems based on the binary bits to aid in our computational tasks. These systems could be binary logic (restricted
only to true or false values), base-2 number representation of numerical values, or using other systems that rely on
a series of binary numbers to represent text, pictures, or sounds.
Essentially, our computers use a series of high-voltage and low-voltage electrical signals (binary values) to
represent everything from texts and numbers to images and sounds. There are special electronic circuits, such as
flip-flops and other circuits, that can "store" or retain these specific patterns of electrical signals for extended use.

For instance, one flip-flop may have a number of inputs that currently has a high voltage output (which we
interpret as 1). Suppose the next two flip-flops have low-voltage outputs 0. We could combine these three outputs
to get a value of 100, which in binary is the same as the number 4.
Understanding binary numbers can thus help us understand some of the fundamentals of computer operations at
a sufficiently abstract level, even though our feeble human intellect might never allow us to understand the full
complexity of computer operations.
And that is just as well, for working with simplified and abstract conceptions of computer operations is more than
adequate for us students of computer science. In the sections that follow, we will take a brief look at some of the
different ways computers use binary symbols to perform some of its most fundamental operations.

Boolean Logic: Using Binary Numbers to Understand Computer Logic

Computer programs use a very specific system of logic to carry out their instructions. This is known as Boolean
logic, formulated by the English mathematician George Boole during the 19th Century.

Boole developed a system of arithmetical and logical operations that utilize the binary system of numbers. Boolean
logic deals with only two possible values: true or false. True is represented by 1 and false is represented by 0. All
logical operations result in only one of these two binary values.
Modern computers use this form of logic to make decisions all the time. These decisions result in our computers
taking a particular course of action instead of another.
Decision-
making in Computers
To realize how crucial this system is for computers, one need not look any further than the existence of Logical
Operators in most programming languages: the AND, OR, and NOT operators.

These operators are directly taken from the AND, OR, and NOT operations from Boolean logic. And anyone with a
cursory knowledge of programming knows that these operations are central to programming.

But the influence of Boole's work doesn't end there. In fact, many programming languages have a data type
named boolean, which can only store either "true" or "false" i.e. 1 or 0.
These boolean variables and logical operators are fundamental components used in implementing conditional
statements and control statements in programming languages. As a result, their importance cannot be overstated,
since this is Programming 101.
There are also many other, more creative, and more sophisticated ways we can use binary numbers in
programming languages. However, this blog post serves as a mere overview of some of the things binary numbers
can be used for.

As such, we won't be diving into any technical programming details. Perhaps I will explore more of those topics in
later blog posts. For now, let us just explore the simpler topic of numerical representations in computers.

Representing Numerical Values in Base-2

Numerical values are represented in our computer systems in some form of the base-2 number system. The normal
numbers we use in everyday life is the base-10 number system. For instance, the number 135 gives us a value of
one hundred and thirty-five.
Decimal Place Values
As we can see from the image above, each digit starting from the right side is multiplied by increasing powers of 10,
starting with (10 ^ 0 = 1), then (10 ^ 1 = 10) and finally (10 ^ 2 = 100). The more the digits, the more the succession
of powers of 10. This is the reason why this number system is called the base-10 number system.
The base-2 number system works in the same way, except that we multiply each bit (a binary "digit") with
successive powers of 2. As an example, let us take the base-2 number 1011 and see what base-10 number it
represents.
Binary Place Value
As we can see, the binary number 1011 is equivalent to the number eleven (11) in base-10.
Of course, the way binary numbers are grouped also matters. We know that 1011 represents the number 11 in base-
10. But what if we grouped the same series of bits as 10 11? Are they two different numbers 10 and 11? Or are they a
single number 1011?
This shows us the importance of the way we group our numbers. And in computers, the numbers are grouped in a
lot of different ways. For instance, the integer data type int in C++ stores a single number in a series of 32 binary
numbers. So the base-10 number 0 is represented by a series of 32 zeroes, while the number 1 is represented by 1
preceded by 31 zeroes to its left.

Textual and Character Representation

We have seen that the base-2 number system forms the basis of numerical representation in our electronic devices.
And while this is true for systems of textual representation, their workings are quite different.

The most common systems for representing characters are ASCII (American Standard Code for Information
Interchange) and Unicode (which is an extension of ASCII). These systems assign unique numeric values to
characters and store them in binary format.
For instance, the ASCII system originally used 7 bits to represent a character. Currently, that has been extended to 8
bits. As an example, the character A is represented by a numeric value of 65 in ASCII. The binary for 65 is 1000001.
Notice that the binary representation consists of 7 bits. In extended ASCII, this will be stored as 01000001 so that
the total number of bits is 8.
Similarly, the ASCII code for the character a is 97, and it is represented by 01100001 in extended ASCII. There are
also very special characters that are represented by 0, 1, 2 and so on. And they are represented
as 00000000, 00000001, 00000010 and so on.
This system serves well for representing English and certain European characters and symbols, but it is woefully
inadequate for representing symbols from languages across the world. In order to accommodate further
symbols, Unicode was developed.
Unicode originally used 21 bits per symbol as opposed to the 7 bits originally used by ASCII. This greatly expands
the range of values that can be used to represent characters. The original ASCII codes are accommodated within
the Unicode system.
Currently, an encoding system based on Unicode, called UTF-8, is the most commonly used encoding system in
web applications. The UTF-8 can use up to 32 bits per symbol, which means it can represent an even larger variety
of characters.

Pixels and Images

Unsurprisingly, images are also frequently represented by numbers. In computers, images are most commonly
made with the help of tiny colored squares called pixels. Think of a mosaic in real life: an image or pattern is made
by combining together numerous small, colored pieces. Or a jigsaw puzzle, where we combine smaller pieces to
create a bigger, complete image.

Pixels work in a similar way. Thousands of tiny colored squares make up the images that are displayed on our
screens. There are many ways the colors in the pixels are coded, but the most commonly used code is the RGB code
(Red, Green, Blue).

RGB codes work by combining red, green, and blue colors to produce all the shades of colors we see in our modern
devices. Each of the three color components is codified by a number, whose values range from 0 to 255. Thus, there
are three sets of numbers that describe a pixel.

As an example, let us consider the color represented by the RGB code (142, 150, 123). This color code has 3
components: Red = 142, Green = 150, and Blue = 123.
Inside our computers, each of these color components are represented by their binary equivalents using 8 bits, and
then combined together. For example, the binary for 142 (Red component) is 10001110, the binary for 150 is
10010110, and the binary for 123 is 1111011.

Red = 142 = 10001110


Green = 150 = 10010110
Blue = 123 = 01111011
The computer combines these numbers from left to right to store the RGB code in its memory.

Complete RGB code = 100011101001011001111011

Working of RGB Code


Thus, we can see that even images are represented in binary. In fact, the knowledge of the binary codes of image
pixels opens the doorway for fun little applications of image manipulation, such as hiding one image inside
another. I have already written about a simple method of image hiding in my previous blog Steganography: Hiding
Information Inside Pictures. You can check it out for an actual practical application of binary numbers in computer
science.

You might also like