Binary Numbers
Binary Numbers
Prashant Dhewaju
Module schedule
Week Theory Practical MOs Course Campus/Online
Works
Release
W1 Course overview, Computer Hardware: Introduction to Introduction of Computer Hardware + Digital 1,2 Online
Number system, Digital Systems, Logic logic Circuit Experiments
W2 Computer Hardware: Encoders / Decoders, Memory Decoders/Encoders circuits + Memory Circuits 1,2 CW1 Online
Segments, Shift + Shift Circuits
W3 Addition, Subtraction, Multiplication, Division. Putting Adder + Subtractor + Multiplier + Divider 1,2 CW2 Campus
all the Logic together Circuits
W4 Computer Hardware: I/O interrupts, Assembly language Assembly programming: Data structure, 2,3, 5 Campus
and memory segments, Mod functions, output at Addressing
specific location
W5 Indirect Memory addressing, Indirect addressing, Flag Assembly programming: Examples using 3,6
register, Semi-conditional loops, Programming, different interrupts Campus
languages
W6 Programming languages and compilers, different Programming in C + Data Structures in C 4,6,7
techniques to Program, Data structures, Stack and
Queues Campus
W7 Link lists, Linear Arrays, Representation of arrays in Link list + Arrays + Memory + Trees in C 7,8 CC1
memory, Trees Online
W8 Introduction to Networks, client server model, types of Network Cabling & Testing 6, 8 Online
networks, transmission media
Cont…
W9 Characteristics of transmission media, Basics of Linux commands 5,8 CW3 Campus
cellular networks, network topologies
W10 Cryptography and network security, AES and RSA Encryptions + SHA2 5,8 Campus
Security attacks and encryption Hash Function in C
W11 Operating System, memory Linux file management and shell 5,8 Campus
management, processor management, scripting
device management,
W12 File management, Security, Processes Finite State machines 4,6 Campus
and threads, Finite State machines Programming in C
• Component-B (50%)
1. Library Assignment 5% total module marks, will be announced in 2nd week.
2. Programming assignment 1 with report (800 words) 22.5% module marks
3. Programming assignment 2 with report (800 words) 22.5% module marks
Introduction and context
Computer Hardware
1.The Principal Functional Units and the Fetch-execute cycle
2. Interrupts
3. Numbers and Logic circuits
4. Memory circuits
5. Adding, Subtraction, Multiplication, Division circuits.
Operating Systems
1. Memory Management and Scheduling
2. Processes and Threads
3. Introduction to Linux
4. Comparing Windows and Linux
Caching Programming
1. Languages and Compilers
2. Different ways to programme
3. Finite State Machine
4. Using Threads and Semaphores
5. Data Structures
Introduction and context
Networking
1. LAN and WAN
2. Cell Phone Network
3. Client Server
4. Security Problems
5. Security Solutions
Rounding up
1. The move to low power consumption and sustainability
2. Pulling it all together
Lecture Content
• Bases
• Floating Point
• Storing Numbers
• Strings
Numbers
• an arithmetical value, expressed by a word, symbol, or
figure, representing a particular quantity and used in
counting and making calculations.
We use denary (Base 10)
1 * 1000 + 2 * 100 + 3 * 10 + 4 * 1
Which is the same as...
3 2 1 0
1 *10 + 2 * 10 + 3 * 10 + 4 * 10
This pattern is true for any base...
1234 = 1 * 103 + 2 * 102 + 3 * 101 + 4 * 100
1234 = 1 * 53 + 2 * 52 + 3 * 51 + 4 * 50
1234 = 1 * 73 + 2 * 72 + 3 * 71 + 4 * 70
1234 = 1 * 83 + 2 * 82 + 3 * 81 + 4 * 80
Next is 2 to the
No, so we now have What about 2 to the Yes, so we have
power of 3 (i.e. 8)
10??? power of 2 (i.e. 4)? 101??, leaving 3
less than 7?
Finally we have
Next we have 10111 which is
1011?, leaving 1 binary for 23
Hexadecimal numbers have the range 0 to 15...
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
Converting between hex and binary is easy...
Let's convert A79 to binary
• A is 1010, 7 is 0111 and 9 is1001
1.01100010100
giving 1011000.10100
Step 8 → Convert 1011000.10100 to denary, do the bit to the left first...
1011000 = 64 + 16 + 8 = 88
Step 9 → Convert the bit on the right...
.10100 = 1/2 + 1/8 = 0.5 + 0.125 = 0.625
Step 10 → Add the two halves together giving 88.625
Step 11 → Remember the sign bit is 1? This means that it is a negative number so the
answer is -88.625
Example 2
What is the floating-point value of the 32-bit hexadecimal
number 43086000?
Q. 43086000
Step 1 → Throw away the trailing zeros giving 43086
Step 2 → Convert to binary giving 0100 0011 0000 1000 0110
Step 3 → Split the binary like so...
0 – 10000110 - 00010000110
the first bit is the sign bit the next eight are the exponent and what is left is the fractional part of the
mantissa
Step 4 → Convert the exponent to denary (base 10) giving 134
Step 5 → Subtract 127 from the exponent, which is currently 134, giving 7
Step 6 → Take the fractional part of the mantissa (00010000110) and place 1. on the front giving
1.00010000110
Step 7 → The exponent is +7 so we need to move the decimal place in the mantissa 7 places to the right
1.00010000110
giving 10001000.0110
Answer = 42708000
Computer and Network Systems CC1 January
2015
What is the 32-bit hexadecimal value represented by the floating point
number 33.750?
Answer = 42070000
Computer and Network Systems CC1 January
2016
What is the 32-bit hexadecimal value represented by the floating point
number -86.500?
Answer = C2AD0000
Computer and Network Systems CC1 January
2016
What is the floating-point value represented by the 32-bit hexadecimal
number 42418000?
Answer = 48.375
Storing Integer
Numbers
Storing Numbers in computer
Big-endian little-endian
Address contents Address contents
0x1000 4F 0x1000 52
0x1001 52 0x1001 4F
Characters
Null terminator
Characters
Case Study 3
spoofing ssl certificates strings
Thank you