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

Number Systems

Computers use binary because: - All data must be converted to binary to be processed - Binary uses only two values, 0 and 1, which can represent on/off switches in computers - Any type of data, such as text and images, must be converted to binary before processing Logic gates are used to perform operations on binary data using Boolean logic. Common logic gates include AND, OR, and NOT gates. Registers temporarily store binary data during processing by the CPU. Number systems used in computing include binary, decimal, and hexadecimal. Binary uses two digits while hexadecimal uses 16, allowing it to represent binary data more concisely. Converting between number systems involves writing values as powers of
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)
80 views

Number Systems

Computers use binary because: - All data must be converted to binary to be processed - Binary uses only two values, 0 and 1, which can represent on/off switches in computers - Any type of data, such as text and images, must be converted to binary before processing Logic gates are used to perform operations on binary data using Boolean logic. Common logic gates include AND, OR, and NOT gates. Registers temporarily store binary data during processing by the CPU. Number systems used in computing include binary, decimal, and hexadecimal. Binary uses two digits while hexadecimal uses 16, allowing it to represent binary data more concisely. Converting between number systems involves writing values as powers of
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/ 10

Why Computers Use Binary

 All data needs to be converted to binary to be processed by a computer


 Binary is a numbering system that uses only 0s (off) and 1s (on) 
 A computer uses binary data for all of its operations
 The 0’s and 1’s are called bits. “Bits” is short for binary digits
 A bit is the smallest unit of data a computer can use (a single 0 or 1)
 Bits can be grouped to form larger units of data, such as bytes,  kilobytes, etc. 
 By using binary, computers can process and store data using electronic switches that
can be either on or off 
 Millions or billions of switches fit onto a microchip
 Any form of data, including text, images, and sound, needs to
be converted to binary before it can be processed by a computer
 This conversion process involves assigning a binary code to each character, pixel, or
sample in the data
 The resulting binary code can then be processed using logic gates and stored in registers

Logic Gates

 Logic gates are electronic devices that perform logical operations on binary data
 The most common types of logic gates are AND, OR, and NOT gates, which can be
combined to perform more complex operations

 AND and OR gates both have 2 inputs (A and B) whereas a NOT gate only has 1 input (A)
 X is the output from the logic gate
 Logic gates are used to process binary data by applying Boolean logic to the input
values and producing a binary output
 Registers are temporary storage areas in a computer's CPU (central processing unit) that
hold binary data during processing
 Registers are used to store data that needs to be accessed quickly, such as variables in a
program or data being manipulated by logic gates
 The size of a register determines the maximum amount of binary data that can be stored
in it at one time

The Denary, Binary & Hexadecimal Number Systems

 In Computer Science there are 3 numbering systems used to represent data:


o Denary
o Binary
o Hexadecimal 
 The denary number system, also known as the decimal system, is a base-10 numbering
system that uses 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9
 Denary numbers can be used to represent any quantity, including whole numbers,
fractions, and decimals
 Each digit in a denary number represents a power of 10, with the rightmost digit
representing 100, the next representing 101, and so on
 It is necessary to convert data from one number system to another eg. denary to binary
or denary to hexadecimal
 It is much easier to do conversions with a table:
o The number 3268 (three thousand two hundred and sixty-eight) can be
represented in the following table:

 (3 x 1000) + (2 x 100) + (6 x 10) + (8 x 1) = 3268

The Binary Number System

 The binary number system is a base-2 numbering system that uses only two digits: 0


and 1
 Each digit in a binary number represents a power of 2, with the rightmost digit
representing 20, the next representing 21, and so on.
 Eg: the number 12 represented in binary is 1100:

 We know this as (1 x 8) + (1 x 4) + (0 x 2) + 0 x 1) =12


 
The Hexadecimal Number System:

 The hexadecimal number system is a base-16 numbering system that uses 16 digits: 0,


1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F where 10 is represented by A, 11 by B and so on
up to 15 represented by F
 Each digit in a hexadecimal number represents a power of 16, with the rightmost digit
representing 160, the next representing 161, and so on
 E.g. the number 146 represented in hexadecimal is 92

 (0 x 4096) + (0 x 256) + (9 x 16) + (2 x 1) = 146

Exam Tip
You need to be able to make conversions in both directions, e.g. denary to binary or
binary to denary. Make sure you write the table the correct way round (with 1 in the
right hand column) & use the correct number of bits in your answer (the question
should tell you but use multiples of 4 bits if you’re not sure)

Converting Between Binary & Denary,


Converting Between Binary & hexadecimal,
Converting Between denary & hexadecimal,
Hexadecimal

 Hexadecimal numbers are often used as a beneficial method of data representation in


computer science 
 It takes fewer digits to represent a given value in hexadecimal than in binary
 One hexadecimal digit can represent four bits of binary data
 It is beneficial to use hexadecimal over binary because:
o The more bits there are in a binary number, the harder it is to read
o Numbers with more bits are more prone to errors when being copied
Worked Example

 The following binary number has 24 bits: 101110110011101011101010. Write the


number in hexadecimal and explain why it is better to write the number in hexadecimal
rather than in binary.
 This number can be represented with only 6 digits in hexadecimal: B [1 mark]  B [1 mark]
3 [1 mark] A [1 mark]  D [1 mark]  2 [1 mark] .
 This number is:
o Much shorter and a more efficient way of representing numbers [1 mark] 
o Easier to spot any errors in [1 mark]

Uses of Hexadecimal in Computers:

 Using hexadecimal allows computer scientists to represent large amounts of


binary data in a more manageable and readable format

 There are many uses of hexadecimal in computers:


o Memory addresses and other hardware related values
o Representation of colour values
o Error messages
o Memory dump
o Debugging
o IP addresses
o ASCII / Unicode 
o Assembly language 
o URLs 

 Representation of colour values in HTML/CSS and in computer graphics: eg. RGB (red-


green-blue) colour values can be represented in a compact and readable format.
E.g. #FF0000
 Error messages & debugging: eg. 0x80070643 to give technicians/developers
information about what the error is in relation to

 Memory dump: this is a record of what happened in the computer's memory at the time
of an error. These are often difficult to read because they contain a lot of technical
information, but computers can use hexadecimal values in memory dumps to
identify specific memory locations and values.
o Eg. A video game on a computer crashes and a memory dump is created. A
technician analyses the memory dump and looks for hexadecimal values to
identify the cause of the crash. They might look for specific memory addresses
and values that relate to the game being played or the graphics card in the
computer.

 IP addresses: 
o Hexadecimal values can be used to represent each set of numbers in an IP
address
o Each set of numbers can be converted into a two-digit hexadecimal value,
giving a total of eight digits in the IP address
o Eg. the IP address "192.168.0.1" could be represented in hexadecimal as
"C0A80001"
o The hexadecimal values can make IP addresses easier to work with in some cases,
such as when configuring network devices or writing scripts that interact with IP
addresses, however, they are not commonly used in everyday applications or
browsing the internet

 ASCII / Unicode: eg. The letter "A" is represented in ASCII as the decimal value 65,
which is equivalent to the binary value 01000001. This binary value can also be
represented in hexadecimal as the value 41

 Assembly language: 
o Hexadecimal values are used in assembly language to represent the binary code
for the instructions and data 
o Each instruction or data value is represented by a specific sequence of
hexadecimal digits, which can make it easier for programmers to read and
understand the code 
o Eg. "MOV AX, 5" instruction is represented by the hexadecimal value "B805",
which tells the computer to move the value 5 into register AX

 URLs:
o To encode a space in a URL using hexadecimal, the space character is replaced
by a percent sign ("%") followed by the hexadecimal value of the space
character. In ASCII, the space character has a decimal value of 32, which can be
represented in hexadecimal as "20". 
o So, to encode the URL "my website.com/page one" using hexadecimal, it would
look like this: my%20website.com/page%20one

Exam Tip
When a question is asked which asks you to name a certain number of uses of
hexadecimal, ensure you write the number asked for and no more. E.g. name 3 uses of
hexadecimal - if you write more than 3, the last ones will be ignored by the examiner,
even if they’re correct

Character Sets
 Text is a collection of characters that can be represented in binary, which is the
language that computers use to process information
 To represent text in binary, a computer uses a character set, which is
a collection of characters and the corresponding binary codes that represent
them
 One of the most commonly used character sets is the American Standard Code
for Information Interchange (ASCII), which assigns a unique 7-bit binary code to
each character, including uppercase and lowercase letters, digits, punctuation
marks, and control characters
 E.g. The ASCII code for the uppercase letter 'A' is 01000001, while the code for
the character '?' is 00111111
 ASCII has limitations in terms of the number of characters it can represent, and it
does not support characters from languages other than English
 To address these limitations, Unicode was developed as a character encoding
standard that allows for a greater range of characters and symbols than ASCII,
including different languages and emojis
 Unicode uses a variable-length encoding scheme that assigns a unique code to
each character, which can be represented in binary form using multiple bytes
 E.g. The Unicode code for the heart symbol is U+2665, which can be
represented in binary form as 11100110 10011000 10100101
 As Unicode requires more bits per character than ASCII, it can result in larger
file sizes and slower processing times when working with text-based data

Representing Sound

 Sound is a type of analog signal that is captured and converted into digital


form to be processed by a computer.
 To convert sound into digital form, a process called sampling is used. This
involves taking measurements of the sound wave at regular
intervals and converting these measurements into binary data
 The quality of the digital sound depends on the sample rate, which is
the number of samples taken per second. A higher sample rate results in
a more accurate representation of the original sound wave, but
also increases the file size of the digital sound
 E.g. A typical CD-quality digital sound has a sample rate of 44.1 kHz, which
means that 44,100 samples are taken per second
 The sample resolution is another factor that affects the quality of the digital
sound. This refers to the number of bits per sample, which determines the level
of detail and accuracy of each sample
 A higher sample resolution results in a more accurate representation of the
sound wave, but also increases the file size of the digital sound
 E.g. A CD-quality digital sound typically has a sample resolution of 16 bits,
which means that each sample is represented by a 16-bit binary number
 It's important to choose the appropriate sample rate and resolution based on the
specific requirements of the digital sound application. E.g. A high-quality music
recording may require a higher sample rate and resolution than a voice recording
for a podcast

 MIDI 
o Musical Instrument Digital Interface (file) 
o Stores a set of instructions (for how the sound should be played) 
o It does not store the actual sounds 
o Data in the file has been recorded using digital instruments
o Specifies the note to be played 
o Specifies when each note plays and stops playing
o Specifies the duration of the note 
o Specifies the volume of the note 
o Specifies the tempo 
o Specifies the type of instrument 
o Individual notes can be edited 

 MP3 
o MP3 is a format for digital audio 
o MP3 is an actual recording of the sound 
o MP3 is a (lossy) compression format
o It is recorded using a microphone

Representing Images

 A bitmap image is made up of a series of pixels, which are small dots of colour
that are arranged in a grid. Each pixel can be represented by a binary code,
which is processed by a computer
 The resolution of an image refers to the number of pixels in the image.
A higher resolution image has more pixels and is, therefore, sharper and more
detailed but also requires more storage space
 The colour depth of an image refers to the number of bits used to represent
each colour. A higher colour depth means that more colours can be
represented, resulting in a more realistic image but also requires more
storage space
 E.g. an 8-bit colour depth allows for 256 different colours to be represented
(28=256), while a 24-bit colour depth allows for over 16 million different
colours to be represented (224=16,777,216)
 The file size of an image increases as the resolution and colour depth
increase. This is because more pixels and colours require more binary data to
represent them
 The quality of an image also increases as the resolution and colour depth
increase. However, it's important to balance the desired quality with the practical
limitations of storage space

Data Storage

 Data storage is measured in a variety of units, each representing a different size of


storage capacity. The smallest unit of measurement is the bit, which represents a single
binary digit (either 0 or 1)
 A nibble is a group of 4 bits, while a byte is a group of 8 bits
 Kibibyte (KiB), mebibyte (MiB), gibibyte (GiB), tebibyte (TiB), pebibyte (PiB),
and exbibyte (EiB) are all larger units of measurement
 Specifically,
1 KiB is equal to 2^10 bytes,
1 MiB is equal to 2^20 bytes,
1 GiB is equal to 2^30 bytes,
1 TiB is equal to 2^40 bytes,
1 PiB is equal to 2^50 bytes,
and 1 EiB is equal to 2^60 bytes

To calculate the file size of an image file:

 Determine the resolution of the image in pixels (width x height)


 Determine the colour depth in bits (e.g. 8 bits for 256 colours)
 Multiply the number of pixels by the colour depth to get the total number of bits
 Divide the total number of bits by 8 to get the file size in bytes
 If necessary, convert to larger units like kibibytes, mebibytes, etc

Worked Example
Calculating image file size walkthrough:
An image measures 100 by 80 pixels and has 128 colours (so this must use 7 bits)

100 x 80 x 7 = 56000 bits ÷ 8 = 7000 bytes ÷ 1024 = 6.84 kibibytes

To calculate the file size of a sound file:

 Determine the sample rate in Hz (e.g. 44,100 Hz)


 Determine the sample resolution in bits (e.g. 16 bits)
 Determine the length of the track in seconds
 Multiply the sample rate by the sample resolution to get the number of bits per second
 Multiply the number of bits per second by the length of the track to get the total
number of bits
 Divide the total number of bits by 8 to get the file size in bytes
 If necessary, convert to larger units like kibibytes, mebibytes, etc

Worked Example
Calculating sound file size walkthrough:
A sound clip uses 48KHz sample rate, 24 bit resolution and is 30 seconds long.
48000 x 24 = 1152000 bits per second x 30 = 34560000 bits for the whole clip
34560000 ÷ 8 = 4320000 bytes ÷ 1024 = 4218.75 kibibytes ÷ 1024 = 4.12 mebibytes

Exam Tip
Remember to always use the units specified in the question when giving the final
answer.

Compression

 Lossless Compression:
o A compression algorithm is used to  reduces the file
size without permanently removing any data
o Repeated patterns in the file are identified and indexed
o Techniques like run-length encoding (RLE) and Huffman encoding are
used
o RLE replaces sequences of repeated characters with a code that
represents the character and the number of times it is repeated
o Huffman encoding replaces frequently used characters with shorter codes
and less frequently used characters with longer codes
 Lossy Compression:
o Lossy compression reduces the file size by permanently removing some
data from the file
o This method is often used for images and audio files where minor details
or data can be removed without significantly impacting the quality
o Techniques like downsampling, reducing resolution or colour depth,
and reducing the sample rate or resolution are used for lossy
compression
o The amount of data removed depends on the level of compression
selected and can impact the quality of the final file
 Overall:
o Compression is necessary to reduce the size of large
files for storage, transmission, and faster processing
o The choice between lossy and lossless compression methods depends on
the type of file and its intended use
o Lossy compression is generally used for media files where minor data loss
is acceptable while lossless compression is used for text, code, and
archival purposes

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy