0% found this document useful (0 votes)
19 views2 pages

(Chapter 1) Use of Binary and Hexadecimal Number

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)
19 views2 pages

(Chapter 1) Use of Binary and Hexadecimal Number

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/ 2

Computer Science

Teacher: Maruf Ahmed


Chapter 1 (Data representation)
Analog data, Digital data, Uses of Binary number and Hexadecimal number

Analog data:
• Data values that are continuously changing
• Analog data is continuous and non-discrete data
• Example: Data such as sound wave, data collected by sensors etc.

Digital data:
• Discrete (individually separate and distinct) data that has only two values.
• For example, binary data which is either 1 or 0.

Why computer uses Binary numbers?


• Computers use voltages and since voltages changes often, no specific voltage is set for each number
in the decimal (denary) system. For this reason, Binary number is used as binary is measured as a
two-state system i.e., on or off or 1 or 0.
• Also, to keep calculations simple, computers use the binary number system

Why data is stored as binary in computers?


• Computers use switches / logic gates which has only 2 states either ‘On’ state or ‘Off’ state and are
represented by 1 and 0 respectively.

Why the data is converted to binary by the computer.


• Computer uses logic gates or switches that only processes the values 1 and 0 or that only have two
states either ON state or OFF state.

Uses of binary number in computer:


Binary numbers are used to store:
• data
• instruction
• ASCII value / Unicode value / character
• number
• image
• sound
• address in main memory

Why human uses Hexadecimal numbers?


• Hexadecimal numbers are used in many areas of computing to simplify binary codes because four
binary digits can be represented by one hexadecimal digit
Page 1 of 2
• It is used by humans to shorten binary to a more easily understandable form

Does the computer use Hexadecimal number?


• It is important to note that computers do not use hexadecimal
• Hexadecimal is translated into binary for computer use

Benefits of using hexadecimal notation to represent binary values:


• Easier to read/write/understand
• Easier to remember
• Short way to represent binary // Uses less screen/display space
• Easier to find errors
• Easier to debug (Debugging is the process of finding and correcting existing and potential errors
(also called bugs))
• Conversion from hexadecimal to binary is easier than denary to binary
• Faster than binary for entering numbers

Why a programmer might prefer to read the instruction in hexadecimal rather than in binary?
• Easier/quicker to understand/read
• Easier to debug/identify errors
• Less likely to make a mistake
• Fewer digits are used / shorter // takes up less space on screen // more can be shown on screen / page

Some general uses of Hexadecimal number with examples in computer:


• Used in HTML colour codes / Notations for colour in HTML
e.g., red - # FF0000, green - # 00FF00, blue - # 0000FF (Must be in proper format i.e., RGB)
• Used in memory dump / error codes (shows the memory location of the error codes)
e.g., 5F 3A 09 F1
• Used in MAC (Media Access Control) addresses
e.g., 01-23-45-67-89-AB (in 48 bits) or 01-23-45-67-89-AB-CD-12 (in 64 bits) (Must be in proper
format)
• Used to represent IP addresses
e.g., B1.2A.1F.A2 (in 32 bits for IPv4 version) (Must be in proper format)
e.g., B213:ABC2:C123: AABC: 2323:1322:9392:11AB (in 128 bits for IPv6 version) (Must be in
proper format)
• To generate error messages on the internet
e.g., error #404 page not found, error #503 Service Unavailable, error #502 Bad Gateway server
(Must be with valid value)
• Used in Assembly language
e.g., 5F 3A 09
• Used in Machine Language
e.g., AB 2C F2
• Used as locations (address) in memory
e.g., AA 09 F1

How a new HTML color code can be created?


- By altering the hexadecimal ‘intensity’ of the primary colours red, green and blue, a new color can
be created.

Page 2 of 2

You might also like