Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 37

Candidates should be able to:

• represent positive numbers in hexadecimal notation


• show understanding of the reasons for choosing hexadecimal notation to represent numbers
• convert positive hexadecimal integers to and from denary (a maximum of four hexadecimal digits will be
required)
• convert positive hexadecimal integers to and from binary (a maximum of 16 bit binary numbers will be
required)
• represent numbers stored in registers and main memory as hexadecimal
• identify current uses of hexadecimal numbers in computing, such as defining colours in Hypertext Markup
Language (HTML), Media Access Control (MAC) addresses, assembly languages and machine code,
debugging
HEXIDECIMAL
The HEXADECIMAL SYSTEM is very closely related to the
binary system. Hexadecimal (sometimes referred to as simply ‘hex’)
is a base 16 system and therefore needs to use 16 different ‘values’ to
represent each digit.
Base 10=Denary/Decimal
Base 2=Binary System
Base 16=Hexadecimal system
Understand Why
• 1cm • 1 bit = 1 hexa
• 100cm = 1 m • 100000cm = 1000m • 11 = 2 hexa
• 1000m=1km • 100000m=100km • 1000 = 8 hexa
• 1000000m= 1000km • 10001000= 88 hexa
• 100010001000= 888 hexa
• 1010100110011011 =
A99B
Table 1.2
Converting Binary to Hexa
Table 1.2
Converting Binary to Hexa
Converting Hexa
to Binary
Table 1.2
Table 1.2
Converting Hexa
to Binary
Table 1.2
Converting Hexadecimal to Denary
Hexadecimal to Denary
Denary to Hexadecimal
Denary to Hexa
Uses of Hexadecimal
• Memory dumps
• Hypertext mark-up language
• Media Access control
• Web addresses
• Assembly code
Memory dumps
• It is much easier to work with: B 5 A 4 1 A F C
• rather than: 1 0 1 1 | 1 0 0 1 | 1 0 1 0 | 0 1 0 0 | 0 0 0 1 | 1 0 1 0 | 1 1 1 1 | 1
100
• hexadecimal is often used when developing new software or when trying
to trace errors in programs
• When the memory contents are output to a printer or monitor, this is
known as a MEMORY DUMP
Figure 1.6
• A program developer can look at each of the hexadecimal codes (as shown in
Figure 1.6) and determine where the error lies. The value on the far left shows the
memory
• location so that it is possible to find out exactly where in memory the fault occurs.
• This is clearly much more manageable using hexadecimal rather than using binary.
• It’s a very powerful fault-tracing tool, but requires considerable knowledge of
computer architecture in order to interpret the results.
HyperText Mark-up Language (HTML)
• HYPERTEXT MARK-UP LANGUAGE (HTML) is used when writing and
developing web pages
• HTML isn’t a programming language but is simply a mark-up language.
• A mark-up language is used in the processing, definition and presentation of text
(for example, specifying the colour of the text).
• HTML uses <tags> which are used to bracket a piece of code; for example, <td>
starts a standard cell in an HTML table, and </td> ends it.
• Whatever is between the two tags has been defined
HTML code
HTML colours
• HTML code is often used to represent colours of text on the computer
screen. The values change to represent different colours.
• The different intensity of the three primary colours (red, green and blue) is
determined by its hexadecimal value.
HTML
Body tags Heading tags Paragraph tags Style tags
<body> <h1> <p> <style>
<h2> </p>
</body> </style>
</h2>
</h1>
Table tags
<table border=“1”>
<tr>
<td>Name</td>
<td>Surname</td>
<td>Age</td>
</tr>
</table>
Examples of colours
Row colour
<table border="1">
<tr bgcolor="#FF0000">
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<table border="1"> Cell colour
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td bgcolor="#FF0000">January</td>
<td>$100</td>
</tr>
</table>
Body tags
<!DOCTYPE html>
<html> <head>
<style>
body { background-color:#4700ca;}
</style>
</head>
<body>
</body>
</html>
Heading background colour
<!DOCTYPE html>
<html>
<head>
<style>
h1 { background-color:#FF00FF; }
</style>
</head>
<body>
<h1>Welcome to my page</h1>
</body>
</html>
Heading text colour
<!DOCTYPE html>
<html>
<head>
<style>
h1 { color:#FF00FF; }
</style>
</head>
<body>
<h1>Welcome to my page</h1>
</body>
</html>
Example of colours HTML using hexadecimal
<style> <body>

h1 { background-color:#FF00FF; } <h1>CSS background-color example!</h1>


div { background-color:#00FFFF; } <div>
p { background-color:#FFFF00; } This is a text inside a div element.
<p>This paragraph has its own background color.</p>
body { background-color:#4700ca; }
We are still in the div element.
</style> </div>

</body>
Activity 1.8
• Using the internet, find the HTML codes for a number of colours.
• Try entering HTML code into the computer and see how the colours and
font types can be changed to good effect.
• Make use of websites, such as www.html.am/ to produce your own web
pages.
Web address
Web addresses
• A website address, also known as a URL (uniform resource locator), is
an Internet or intranet name that points to a location where a file,
directory or website page is hosted
• Each character used on a keyboard has what is known as an ASCII
CODE (AMERICAN STANDARD CODE FOR INFORMATION
INTERCHANGE)
• These codes can be represented using hexadecimal values or decimal
values
ASCII table
• A good example of the use of ASCII codes is the representation of a web
address (or URL, which stands for uniform resource locator) such as
www.hodder.co.uk which becomes (using hexadecimal values):

You might also like