Computer Science 1
Computer Science 1
Deepanjal Shrestha
Lecturer
Pokhara University, School of
Business
The Number System
Basically 2 Types
• Decimal Number System denary (base 10)
number system which counts in multiples
of 10
The Number System
• The binary system based on the number 2
• Thus, only the two ‘values’ 0 and 1 can be
used in this system to represent each digit
Representation of Data in Computer Systems
Converting Binary Numbers
In your exam you will be expected to be able to convert a
denary number (the numbers humans work with (base 10)
into binary…
128 64 32 16 8 4 2 1
1 0 0 0 0 1 0 1
2. Then simply add the values where there is a 1 underneath, together.
Representation of Data in Computer Systems
Converting from Binary to Denary (easy)
128 64 32 16 8 4 2 1
1 0 1 1 0 0 1 1
1 0 0 0 1 1 1 1
0 0 1 1 1 1 0 0
1 0 1 1 1 1 0 0
Representation of Data in Computer Systems
Method 1: Converting from Denary to Binary
1
Representation of Data in Computer Systems
Converting from Denary to Binary
1 1
Representation of Data in Computer Systems
Converting from Denary to Binary
1 1 0
Representation of Data in Computer Systems
Converting from Denary to Binary
1 1 0 0
Representation of Data in Computer Systems
Converting from Denary to Binary
1 1 0 0 1
Representation of Data in Computer Systems
Converting from Denary to Binary
1 1 0 0 1 0
Representation of Data in Computer Systems
Converting from Denary to Binary
1 1 0 0 1 0 1
Representation of Data in Computer Systems
Converting from Denary to Binary
1 1 0 0 1 0 1 0
Representation of Data in Computer Systems
Converting from Denary to Binary
128 64 32 16 8 4 2 1
Mini Whiteboard Practice
• Convert 42 into binary:
128 64 32 16 8 4 2 1
Mini Whiteboard Practice
• Convert 175 into binary:
128 64 32 16 8 4 2 1
Converting from Denary to
Binary
Method 2:
• BF08
• Again just use Table
• 1011 1111 0000 1000
• Then put all the digits together:
• 1011111100001000
Activity 1.5
• Convert the following hexadecimal
numbers into binary:
• 59
• AA
• A00
• 40E
• BA6
• DA47
Hexadecimal to Denary
• Convert
–45A
• First multiply each digit by its value:
Web Addresses
• Every character on a computer has a
ASCII value.
• Web addresses are represented as hex
values
ASCII values
Representing a web address
Assembly and Machine Code
• Computer memory can be referred to
directly using machine code or assembly
code.
• JNZ FFA4 (assembly code)
• A5E4 FFA4 (machine code using
hexadecimal values)
• 1010 0101 1110 0100 1111 1111 1010
0100 (machine code using binary)
• Machine
Any Questions