0% found this document useful (0 votes)
14 views8 pages

Week 3.1

This document provides an overview of data representation in binary numbers. It discusses number systems such as binary, octal, and hexadecimal and how to convert between decimal and other bases. It also covers adding in binary. The main topics are methods for representing integers: signed magnitude representation, 1's complement, and 2's complement. It explains how each method represents positive and negative numbers and the ranges they allow. It provides examples of integers represented in 8-bit binary. The document concludes with an assignment asking students to write about floating point number representation and endian formats, with a deadline of March 27th.

Uploaded by

usmanaslam17621
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views8 pages

Week 3.1

This document provides an overview of data representation in binary numbers. It discusses number systems such as binary, octal, and hexadecimal and how to convert between decimal and other bases. It also covers adding in binary. The main topics are methods for representing integers: signed magnitude representation, 1's complement, and 2's complement. It explains how each method represents positive and negative numbers and the ranges they allow. It provides examples of integers represented in 8-bit binary. The document concludes with an assignment asking students to write about floating point number representation and endian formats, with a deadline of March 27th.

Uploaded by

usmanaslam17621
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Computing Fundamentals

Data Representation – Binary Numbers


Week 3 Instructor: Shehzad Aslam
Review
 Number System
 Binary, octal, hexadecimal system
 Conversion from decimal system to another & vice versa
 Addition in binary system
 Finding Range of numbers that can be stored in particular storage space
Representing Integers
 Signed Magnitude
 1’s Complement
 2’s Complement
Signed magnitude
 MSB is reserved and represent sign
 1 is negative 0 is positive
 12 = 00001100 ; -12 = 10001100
 Range -2N-1-1 to 2N-1-1
 Has two representations of zero
127 = 01111111
-127 = 10000000
1’s Complement 128 = 10000000 overflow using 8-bits
-128 = 01111111 underflow using 8-bits
 Represent no is binary 255 = 11111111 error using 8-bits so reserved for zero
-255 = 00000000 error using 8 bits so reserved for zero
 If no is positive then it’s the result
 If no is negative
 Then invert all the bits (i.e take complement)
 Range -2N-1-1 to 2N-1-1 has two representations of zero
 Addition
 Add the numbers and around the carry (add in LSB)
 Subtraction
 Take complement of the number to be subtracted
 Perform addition and around the carry if
127 = 01111111
2’s Complement -128 = 10000000
128 = 10000000 overflow

 Represent no is binary
 If no is positive then it’s the result
 If no is negative
 Then take 1s complement and add 1 to LSB
 Range -2N-1 to 2N-1-1, does not have two representations of zero
 Addition
 Add the numbers and discard the carry if
 Subtraction
 Take 2’s complement of the number to be subtracted
 Perform addition and discard the carry if
Assignment

 How floating point numbers are represented in computer? What is big


endian and little endian representation?
 Deadline
 Saturday 27 Mar, 2020 11:59PM
 Hand written pics in MS word document
 Email at [email protected]
 File name must be your regno
 Subject: CF IME 2020 – ASSIGNMENT 1
 Follow the above guidelines, any violation in submission will not be
marked
Reading

 Chapter 2 from Computer Science an Overview

You might also like