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

StdSupport-NumberSystem(encrypted)

The document provides an overview of number systems, including binary, octal, decimal, and hexadecimal, detailing their bases and digits. It explains the concepts of system radix, place value, and methods for converting between these systems, including both traditional and direct methods. Additionally, it covers the significance of bits and bytes in computing, illustrating how binary numbers are used to represent data.

Uploaded by

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

StdSupport-NumberSystem(encrypted)

The document provides an overview of number systems, including binary, octal, decimal, and hexadecimal, detailing their bases and digits. It explains the concepts of system radix, place value, and methods for converting between these systems, including both traditional and direct methods. Additionally, it covers the significance of bits and bytes in computing, illustrating how binary numbers are used to represent data.

Uploaded by

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

COMPUTER SCIENCE – 2210

HANDOUT
Number System

Number System
“A number system is a method of calculation and counting and working with digits and
numbers.”
Scientists and mathematicians use four numbers systems as follows:

NUMBER SYSTEM BASE NO. OF DIGITS DIGITS


Binary 2 2 0, 1
Octal 8 8 0,1,2,3,4,5,6,7
Decimal 10 10 0,1,2,3,4,5,6,7,8,9
Hexadecimal 16 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

System radix/base: The number of digits allowed by a number system is known as base or
radix of that number system.

SAMREEN NISAR
OR
The number of values that can be expressed by a single digit in any number system is
called system radix.

Place value: The position of each digit in a number. (Always counted from right hand side)
In binary number system
128 64 32 16 8 4 2 1
2 7
2 6
2 5
2 4
2 3
2 2
2 1
20

In decimal number system


10000000 1000000 100000 10000 1000 100 10 1
107 106 105 104 103 102 101 100

In hexadecimal number system


1,048,576 65,536 4,096 256 16 1
165 164 163 162 161 160
Page 1

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Rules of Conversion:
◼ Traditional Method:
( )10 → ( )2,8,16 use repeated division
( )2,8,16 → ( )10 use expansion method

◼ Tabular / Direct/ Trial-error Method:


Make a table of base raised to powers (using tables shown in place value topic). But always
insert number starting from right hand side
Conversion type Method
Decimal to binary Repeat division by 2
Decimal to Hexadecimal Expansion method by 16
Binary to Decimal Expansion method by 2
Binary to Octal 3 bits relation (right to left)
Binary to Hexadecimal 4 bits relation (right to left)
Octal to Binary 3 bits relation (right to left)
Hexadecimal to Decimal Repeat division by 16

SAMREEN NISAR
Hexadecimal to Binary 4 bits relation (right to left)

Binary Number System


In an 8-bit binary number system the counting is done using the following binary scale:
8 7 6 5 4 3 2 1
128 64 32 16 8 4 2 1

Binary counting may be represented (by adding each bit’s value) using binary scale as
follows:
128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 1 1
Decimal numbers

0 0 0 0 0 0 1 0 2
0 0 0 0 0 0 1 1 3
0 0 0 0 0 1 0 0 4
0 0 0 0 0 1 0 1 5
0 0 0 0 0 1 1 0 6
0 0 0 0 0 1 1 1 7
0 0 0 0 1 0 0 0 8
0 0 0 0 1 0 0 1 9
0 0 0 0 1 0 1 0 10
Page 2

Binary numbers

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Bits and Binary
Computers use binary - the digits 0 and 1 - to store data. A binary digit, or bit, is the smallest
unit of data in computing. It is represented by a 0 or a 1. Binary numbers are made up of
binary digits (bits), e.g. the binary number 1001.

Bit: Short for binary digit. The smallest unit of information handled by a computer. One bit
expresses a 1 or a 0 in a binary numeral, or a true or false logical condition, and is represented
physically by an element such as a high or low voltage at one point in a circuit or a small spot
on a disk magnetized one way or the other.

Byte: Short for binary term. A unit of data, today almost always consisting of 8 bits. A byte
can represent a single character, such as a letter, a digit, or a punctuation mark.

Conversion of positive denary integers into binary and positive binary integers into denary

Denary (Decimal) Integers into Binary

SAMREEN NISAR
Method 1:
(26)10 = ( ? )2
Since the denary number (base 10) needs to be converted into the binary number (base 2),
therefore the number has to be divided by 2.

26 divided by 2 is 13, and remainder is 0


2 26
13 divided by 2 is 6, and remainder is 1
2 13 0
Collect all the remainders from bottom to top.
– Hence: 1 1 0 1 0
2 6– 1
2 3– 0
2 1– 1 = (11010)2 is the binary integer of (26)10 Denary integer

Method 2:
(42)10 = ( ? ) 2
Use the binary scale and mark a “1” (on) to the bits positions that add up to make 42.
i.e. 32 + 8 + 2 = 42
128 64 32 16 8 4 2 1
Page 3

1 0 1 0 1 0 = 42

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Binary Integer into Denary

Method 1:

(101)2 = ( ? )10

Since Binary number needs to be converted to denary therefore each digit of binary number
will be multiplied with 2 representing its power in base 10, and their products will be added
together. e.g.

= (1 x 22) + (0 x 21) + (1 x 20)


Since anything to the power zero is 1
= (1 x 4) + (0 x 2) + (1 x 1)
=4+0+1
= 5 or (5)10 (5)10 is the Denary integer of (101)2 binary integer.

Method 2:

SAMREEN NISAR
(11010)2 = ( ? )10

We may also use the binary scale to find out what this binary integer represents in denary
(decimal) number system.

128 64 32 16 8 4 2 1
1 1 0 1 0 = 26

Simply place the binary digits on their bit positions on the binary scale and add them.

Page 4

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Binary Integer into Hexadecimal
Method #1:
First, you need to convert a binary into other base system (e.g., into decimal, or into octal).
Then you need to convert it into hexadecimal number.

Example − Convert binary number 1101010 into hexadecimal number.


First convert this into decimal number:

= (1101010)2
=1X26+1X25+0X24+1X23+0X22+1X21+0X20
= 64 + 32 + 0+ 8 + 0 + 2 + 0
= (106) 10

Then, convert it into hexadecimal number


= (106) 10
=6 X 16 1 + 10 X 16 0
= (6A) 16

SAMREEN NISAR
Method # 2:
There is also a direct method to convert a binary number into hexadecimal number −
grouping which is explained as following below.

Using Grouping
Since, there are only 16 digits (from 0 to 7 and A to F) in hexadecimal number system, so
we can represent any digit of hexadecimal number system using only 4 bits as following
below.
Hexa 0 1 2 3 4 5 6 7 8 9 A B C D E F
Binary 0000 0001 0010 0011 01000 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Steps to convert Binary to Hexadecimal


1. Start from the least significant bit (LSB) at
the right of the binary number and divide it up
into groups of 4 digits. (4 digital bits is called a
"nibble").

2. Convert each group of 4 binary digits to its


equivalent hex value.
Page 5

3. Concatenate the results together, giving the total hex number.

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Hexadecimal into Binary

Steps to Convert Hex to Binary


1. Write down the hex number and represent each
hex digit by its binary equivalent number from the
table above.

2. Use 4 digits and add insignificant leading zeros if


the binary number has less than 4 digits. E.g. Write
102 (2 decimal) as 00102.

3. Then concatenate or string all the digits together.

4. Discard any leading zeros at the left of the binary number.

Hexadecimal into Denary

SAMREEN NISAR
To convert a hexadecimal to a decimal manually, you must
start by multiplying the hex number by 16.
Then, you raise it to a power of 0 and increase that power by 1 each time according to the
hexadecimal number equivalent.
We start from the right of the hexadecimal number and go to the left when applying the
powers.
Each time you multiply a number by 16, the power of 16 increases.
When converting a C9 hexadecimal to a decimal your work should look something like
this:

Example 1
9 = 9 * (16 ^ 0) = 9
C = 12 * (16 ^ 1) = 192
Then, we add the results.
192 + 9 = (201)10

Example 2
In this example, we want to convert hex ABC to a decimal.
Remember that we raise the number 16 to 0 for the rightmost bit of the question.
Page 6

As we move across the numbers and letters, the power 16 is raised by one more than the
previous bit.

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


For example, if we had a number with 22 in the leftmost bit it would be multiplied by 16 to
the power of 21.
C = 12 * (16 ^ 0) = 12

B = 11 * (16 ^ 1) = 176

A = 10 * (16 ^ 2) = 2560
Then, we add the results.
2560 + 176 + 12 = (2748)10

Denary into Hexadecimal


Steps to convert a denary number into hexadecimal

1. To convert from decimal to hexadecimal you must divide the decimal number by 16
repeatedly.

SAMREEN NISAR
2. Then, write the last remainder you obtained in the hex equivalent column.

3. If the remainder is more than nine, remember to change it to its hex letter equivalent.

The answer is taken from the last remainder obtained.

For Example:
201 is a denary number, we will convert it into hexadecimal.

16 201
12 -- 9

12 = C
9=9

So, the answer will be C 9


Page 7

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Understanding of the concept of a byte and how the byte is used to measure memory size

How Bits and Bytes Work

Decimal Numbers
The easiest way to understand bits is to compare them to something you know: digits.

A digit is a single place that can hold numerical values between 0 and 9. Digits are normally
combined together in groups to create larger numbers. For example, 6,357 has four digits. It
is understood that in the number 6,357, the 7 is filling the "1s place," while the 5 is filling the
10s place, the 3 is filling the 100s place and the 6 is filling the 1,000s place. So, you could
express things this way if you wanted to be explicit:

(6 * 1000) + (3 * 100) + (5 * 10) + (7 * 1)

= 6000 + 300 + 50 + 7 = 6357

SAMREEN NISAR
Another way to express it would be to use powers of 10

(6 * 103) + (3 * 102) + (5 * 101) + (7 * 100)

= 6000 + 300 + 50 + 7 = 6357

What you can see from this expression is that each digit is a placeholder for the next higher
power of 10, starting in the first digit with 10 raised to the power of zero.

The Base-2 System and the 8-bit Byte

The reason computers use the base-2 system is because it makes it a lot easier to implement
them with current electronic technology. You could wire up and build computers that
operate in base-10, but they would be fiendishly expensive right now. On the other hand,
base-2 computers are relatively cheap.

So, computers use binary numbers, and therefore use binary digits in place of decimal digits.
The word bit is a shortening of the words "Binary digit." Whereas decimal digits have 10
possible values ranging from 0 to 9, bits have only two possible values: 0 and 1. Therefore, a
Page 8

binary number is composed of only 0s and 1s, like this: 1011. How do you figure out what

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


the value of the binary number 1011 is? You do it in the same way we did it above for 6357,
but you use a base of 2 instead of a base of 10. So:
(1 * 23) + (0 * 22) + (1 * 21) + (1 * 20) = 8 + 0 + 2 + 1 = 11

You can see that in binary numbers, each bit holds the value of increasing powers of 2. That
makes counting in binary pretty easy. Starting at zero and going through 20, counting in
decimal and binary looks like this:
0 0 11 1011
1 1 12 1100
2 10 13 1101
3 11 14 1110
4 100 15 1111
5 101 16 10000
6 110 17 10001
7 111 18 10010
8 1000 19 10011
9 1001 20 10100
10 1010

SAMREEN NISAR
When you look at this sequence, 0 and 1 are the same for decimal and binary number
systems. At the number 2, you see carrying first take place in the binary system. If a bit is 1,
and you add 1 to it, the bit becomes 0 and the next bit becomes 1. In the transition from 15
to 16 this effect rolls over through 4 bits, turning 1111 into 10000.

Bits are rarely seen alone in computers. They are almost always bundled together into 8-bit
collections, and these collections are called bytes. Why are there 8 bits in a byte? A similar
question is, "Why are there 12 eggs in a dozen?" The 8-bit byte is something that people
settled on through trial and error over the past 50 years.

With 8 bits in a byte, you can represent 256 values ranging from 0 to 255, as shown here:
0 = 00000000
1 = 00000001
2 = 00000010
...
254 = 11111110
255 = 11111111
Page 9

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


A transistor is a tiny switch that is activated by the electronic signals it receives. The digits 1
and 0 used in binary reflect the on and off states of a transistor.
The circuits in a computer's processor are made up of billions of transistors.
Computer programs are sets of instructions. Each instruction is translated into machine code
- simple binary codes that activate the CPU. Programmers write computer code and this is
converted by a translator into binary instructions that the processor can execute.
All software, music, documents, and any other information that is processed by a computer,
is also stored using binary.

SAMREEN NISAR
Recognition of the use of binary numbers in computer systems

Storage capacity and file size


Storage capacities and file sizes are measured from lowest to highest in:
▪ bits
▪ bytes
▪ kilobytes
▪ megabytes
▪ gigabytes
▪ terabytes
▪ exabytes
▪ zettabyte
▪ yottabyte
An operating system abbreviates these measurements, e.g. 1 megabyte becomes 1MB
(megabyte).
Page 10

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Memory Representation
Bit: A binary digit is called a bit.
Byte: A series of 8 bits is called a byte. A byte is the smallest space/unit of memory used by
a computer. However, some computers use larger bytes but they are always multiples of 8
i.e. 16 or 32 bits.
Registers: A group of bits is called a register. They are used as a part of control systems by
the computers (or microprocessors). Register are used to quickly accept, store, and transfer
data and instructions that are being used immediately by the CPU, there are various types of
Registers those are used for various purpose.
Relationship between memory sizes
The table below outlines the relationship between bits (smallest) and yottabytes (largest).
Read each row of the table from left to right:

The size of a file and a storage device's


capacity will always be written in its simplest

SAMREEN NISAR
form. For example, an operating system
would report a 1 terabyte hard disk's size as
1TB not as 1024GB, although both are
correct.

Example file sizes


The table below lists files commonly found
on a computer and their typical file size
(compressed):
A file’s size can be influenced by a number of factors but ultimately the more information a
file stores, the larger it will be.
File File size
In Data storage and when describing memory size, a Kilobyte is 2 , 10
Photo 3MB
or 1024 bytes. Bytes are always some multiple or exponent of two. Song 5MB
Film 700MB
Name of memory size Number of bits Equivalent denary value
1 kilobyte(1KB) 210 1024 bytes
1 megabyte (1 MB) 220 1048576 bytes
1 gigabyte (1 GB) 230 1073741824 bytes
Page 11

1 terabyte (1 TB) 240 1099511627776 bytes


1 petabyte (1 PB) 250 1125899906842624 bytes

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Uses of Binary Number system:

The microprocessor makes use of transistors that basically identify voltage levels rather than
any positive value in decimal number system. Therefore, a voltage level ‘high’ or ‘on’ will be
identified as ‘1’ and a voltage level of ‘low’ or ‘off’ will be identified as ‘0’. Binary number
system is therefore used for internal working of electrical computers / microprocessors.

Uses of hexadecimal Number System:

1. HTML: (Hyper Text Markup Language)


HTML is used when writing and developing webpages. A markup language is not a
programming language rather it is used in processing, definition, and presentation of text. It
is often used to represent colors of text on the computer screen.
e.g: to show intensity of 3 basic colors (red, green and blue) hexadecimal value is used and
different colors are generated.

SAMREEN NISAR
# FF 00 00 represents red #FF FF 00 represents yellow
# 00 FF 00 represents green #80 00 80 represents purple
# 00 00 FF represents blue #FF FF FF represents white
# FF 80 00 represents orange #00 00 00 represents black

The 6 digit hex colour code should be considered in three parts.


• First two digits represents the amount of red in the colour (max FF, or 255)
• The next two digits represent the amount of green in the colour (max FF, or 255)
• The final two digits represent the amount of blue in the colour (max FF, or 255)

By changing the intensities of red, green and blue, we can create almost any colour.

E.g. orange can be represented as #FFA500, which is (255 red, 165 green, 0 blue).

HTML Tags
Note: the tags are written b/w < > signs whereas attributes are written without containers.
Tags/ attributes Description / examples
Page 12

<html>……. </html> To start and end a html document


<head> ……. </head> Initiates the head part of the html document
<title> ……. </title> Used for setting the title of the document (tab heading)
<body> …….. </body> Sets the body part of the html document

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


<h1> ……. </h1>

<h2> ….. </h2>

<h3> …… </h3>
<h4> ….. </h4>
<h5> ……. </h5>
<h6> …… </h6>
<p> ……… </p> Paragraph tag. creates paragraph for the text written in b/w.
<br /> Line break tag. Anything following it starts from the next line.
<hr /> To create a line from the current position to the right margin and
break the line.
<i> …… </i> To display content in italic format.
<b> …… </b> The content is shown in bold.
<u> ……. </u> To display content with underline.
align= “left” It is an attribute carried by <p> element which is used to indicate the
align=”center” alignment of the paragraph. example:

SAMREEN NISAR
align=”right” <p align="left">This is left aligned</p>
<p align="center">This is center aligned</p>
<p align="right">This is right aligned</p>
<img src=”image url” /> To insert any image in your webpage. If the image and html file are in
the same folder the whole file path(image url) is not necessary and we
can just give the correct file name and extension.
alt Used in <img /> tag to display text incase the image is not displayed
width To set the width of the image
height To set the height of the image
border To set the image border
Example:
<img src="/html/images/test.png" alt="Test Image" width="150"
height="100" border="3"/>

<li> …… </li> To list content


<ul> ….. </ul> Bulleted list
To set different types of bullets we use type attribute.
<ul type="square">
<ul type="disc">
<ul type="circle">
<ol> …… </ol> Numbered list
<ol type="1"> - Default-Case Numerals.
Page 13

<ol type="I"> - Upper-Case Numerals.


<ol type="i"> - Lower-Case Numerals.
<ol type="a"> - Lower-Case Letters.
<ol type="A"> - Upper-Case Letters.

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


<table> …. </table> To insert a table.
Note:
<tr> …. </tr> Each row will be inserted with <tr> …. </tr>
Each column will be inserted with <td> …. </td>
<td> …. </td>
Example:
<table bgcolor="yellow" width="50%">
<tr>
<td> This is column 1 in row 1 with yellow background </td>
<td> This is column 2 in row 1 with yellow background</td>
</tr>
<tr>
<td> This is column 1 in row 2 with yellow background </td>
<td> This is column 2 in row 2 with yellow background</td>
</tr>
</table>

To set the background colour.

SAMREEN NISAR
bgcolor=“colorname without Eg. <body bgcolor="seablue">
space”
to give hexadecimal value we will write with a # sign example:

background=”image url” To set the background image. It can be used to set image background
on the whole webpage or on a table.
text=”colourname” To set the default color of the text displayed on the webpage. only
used with body tag.
<font color=”colorname”>…. To set font/ text color displayed anywhere on the webpage.
</font>
<font size=”1-7”> to set a size of the font
<font face=”fontstylename”> Sets the font style. example: times of new roman, verdana, comic sans
ms, wildwest, arial etc
<marquee> ……</marquee> to display simple text scrolling
<marquee to display scrolling text in both directions
behavior=”alternate”>
….</marquee>
<marquee to display the plain scrolling text with a pink background
bgcolor="pink">……
</marquee>
<marquee used to set the speed of the scrolling text. It takes amount in pixels
scrollamount=”50”>… moved per second.
Page 14

</marquee>

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Steps to remember:

1. Open notepad and write <html> to initiate the html document.


2. Save the file with html extension instead of .txt i.e. “filename.html”
3. Close the file that was saved and right click on the file and open with browser.
4. Every time a change is made to the file refresh the webpage on the browser to reload
the content and hence see the changes.
5. Save the html file and the images attached in the same folder for easy access.
6. Each tag opened should be closed with a forward slash. i.e. <body> should be closed
with </body>

Parts of HTML

1. Structure consists of the mandatory parts of


an HTML document plus the semantic and structured markup
of its contents.

SAMREEN NISAR
An HTML document has two main parts: the head and
the body. But firstly, every HTML document should start by
declaring that it is an HTML document.

2. Presentation is the style you give the content. In most cases presentation is about the way
a document looks, but it can also affect how a document sounds – not everybody uses a
graphical web browser.

Page 15

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


2. MAC: (Media Access Control)
It refers to NIC (Network Interface Card) which is used to uniquely identify a device on the
internet.
OR
A MAC address is a hardware identification number that uniquely identifies each device on
a network. They are embedded into the network hardware during the manufacturing
process, or stored in firmware, and designed to not be modified.
A MAC address is usually made of 48 bits which are shown in 6 group hexadecimal digits.
NN : NN : NN : DD : DD : DD or
NN – NN – NN – DD – DD – DD

Identity of the manufacturer serial # of the device


Hexadecimal values are used in the MAC addresses to make it easy to detect over the
internet and it also increases user friendliness with the address.

SAMREEN NISAR
Examples of the manufacturer identifiers also called Organizationally Unique Identifier
(OUI)
Identity # of APPLE → 00 – 1C – B3
Identity # of DELL → 00 – 14 – 22
Identity # of CISCO → 00 – 40 – 96
Identity # of INTEL → 00 – A0 – C9

Types of MAC Addresses:


There are two types of MAC addresses
◼ UAA (Universally Administered MAC Address)
A universally administered address is uniquely assigned to a device by its
manufacturer. These are sometimes called "burned-in addresses" (BIA).
◼ LAA (Locally Administered MAC Address)
A locally administered address is assigned to a device by a network administrator,
overriding the burned-in address (UAA).
Note: Universally administered and locally administered addresses are distinguished by setting
the second-least-significant bit of the first octet of the address. This bit is also referred to as the
U/L bit, short for Universal/Local, which identifies how the address is administered. If the bit is
Page 16

0, the address is universally administered. If it is 1, the address is locally administered. In the


example address 06-00-00-00-00-00 the first octet is 06 (hex), the binary form of which is
00000110, where the second-least-significant bit is 1. Therefore, it is a locally administered
address.

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Why MAC address is changed using LAA?
▪ Certain software requires all the MAC addresses of the devices accessing them to follow
a certain strict format, therefore resulting in the change of the addresses.
▪ Routers, networks and firewalls when used with filters require MAC addresses to have a
certain format to be allowed through; otherwise the devices will be blocked.
3. Assembly Language / Machine code:
Computer memory can be directly referred to by using machine code or assembly language.
Hexadecimal code is usually used to write an assembly language program as it is easier, faster
and less prone to error.
Example of assembly language instruction
STO FFA4 (assembly code)
A5E4 FFA4 (machine code using hexadecimal values)
1010 0101 1110 0100 1111 1111 1010 0100 (machine code using binary)

SAMREEN NISAR
Page 17

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


4. Web Addresses:
URL (Universal Resource Locator) is the global address of documents and
other resources on the World Wide Web. Hexadecimal values are used in the address of
files or web pages as a security feature.

Note: When converting each character’s hexadecimal equivalent is preceded by %

SAMREEN NISAR

Such as: www.cie.co.uk which becomes (using hexadecimal values):


Page 18

w w w . c i e . c o . u k
%77 %77 %77 %2E %63 %69 %65 %2E %63 %6F %2E %75 %6B

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


5. Debugging:
Debugging allows programmers to detect, diagnose, and eliminate errors in a program. The
source debugger uses the hexadecimal values of the characters. Hex is often used in error
messages. The hex number refers to the memory location of the error. This helps
programmers to find and then fix problems.

6. Memory Dumps:
A “memory dump” is simply a listing of the contents of a section of a computer’s memory
(or possibly the entire contents). They are used primarily for debugging purposes since they
allow you to see exactly what is contained at each memory location in the dump. In memory
dumping hexadecimal values are preferred as they are easy to work with and understand.

Benefits of Hexadecimal Numbers

SAMREEN NISAR
Hexadecimals are beneficial (over binary) because:

1. They are easier and faster to work with, taking up less screen space.
2. Mistakes are less likely and easier to trace / debug
3. Hexadecimal can be used to write large binary numbers in just a few digits.
4. It makes life easier as it allows grouping of binary numbers which makes it easier to
read, write and understand.
5. It is more human-friendly, as humans are used to grouping together numbers and
things for easier understanding.
Page 19

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


Character set: Text and numbers can be encoded in a computer as patterns of binary digits.
1) ASCII (American Standard Code for Information Interchange): The ASCII character set
is a 7-bit set of codes that allows 128 different characters. It consists of upper- and lower-case
letters of English language only, numbers, symbols.

SAMREEN NISAR
Page 20

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


2) Extended ASCII: Extended ASCII code is an 8-bit character set that represents 256
different characters, making it possible to use characters such as é or ©. Extended ASCII is
useful for European languages.
Extended ASCII Codes

SAMREEN NISAR
Page 21

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]


3) Unicode: Unicode uses between 8 and 32 bits per character, so it can represent any
characters from languages from all around the world. It is commonly used across the internet.

SAMREEN NISAR
Page 22

[[email protected]] [COMPUTER SCIENCE – 2210] [0333-2262955]

You might also like