0% found this document useful (0 votes)
63 views3 pages

Assignment No # 1: University of Gujrat Hafiz Hayat Campus Department of Mathematics

The document is an assignment submission for a course on program language for mathematicians. It contains 11 student names submitting the assignment and details of the course. The assignment question asks how computers store numeric values in 64-bit memory and which protocol they follow. The response explains that computers store data in binary representation using bits as 0s and 1s. It provides examples of decimal to binary conversion. It then describes how 64-bit memory can store large numbers and addresses up to 264. It also explains two's complement notation for signed numbers and issues of big endian versus little endian formatting. Finally, it gives details on double precision floating point representation using IEEE 64-bit format.

Uploaded by

Ch M Sami Jutt
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)
63 views3 pages

Assignment No # 1: University of Gujrat Hafiz Hayat Campus Department of Mathematics

The document is an assignment submission for a course on program language for mathematicians. It contains 11 student names submitting the assignment and details of the course. The assignment question asks how computers store numeric values in 64-bit memory and which protocol they follow. The response explains that computers store data in binary representation using bits as 0s and 1s. It provides examples of decimal to binary conversion. It then describes how 64-bit memory can store large numbers and addresses up to 264. It also explains two's complement notation for signed numbers and issues of big endian versus little endian formatting. Finally, it gives details on double precision floating point representation using IEEE 64-bit format.

Uploaded by

Ch M Sami Jutt
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/ 3

University of Gujrat

Hafiz Hayat Campus


Department of Mathematics
Submitted to:
Assignment No # 1
Mr. Ihsan-ul-Ghafoor

Submitted by:

Saira Nawaz (19011509-050)

Muhammad Sami-Ur Rehman (19011509-051)

Saood Azam (19011509-052)

Fatima (19011509-053)

Qurat-ul-Ain (19011509-054)

Tehmina (19011509-055)

Laiba Shahzadi (19011509-056)

Zia-ur-Rehman (19011509-057)

Sumaiya Zia (19011509-076)

Sidra Abid (19011509-099)

Program:

BS-Mathematics-III

Section:

‘A’

Course title:

Program language for Mathematicians

Course code:

MATH-206

MATH-206 Mr. Ihsan-ul-Ghafoor Page 1


Program language for Mathematicians
Q) How computer stores numeric values in its 64-bit memory? Which
protocol/set of rules it follows?

Ans) Computer always performs given data in the form of bits also called as binary data
represented as 0 and 1. The byte is a unit of digital information that mostly commonly
consists of 8 bits.

Example:

The data can be represented even in terms of decimal. If we have a binary code of 101101 its
representation in decimal will be:

¿ 1× 25 +0 ×24 + 1× 23 +1 ×22 +0 × 21+1 ×20

¿ 32+0+8+ 4+ 0+1=45

64-bit:

A 64-bit can access264 addresses. In short any amount of memory greatly than4 GB can be
easily handled by it.

63 0

Most significant bit Less significant bit


64 bit =8 bytes

Example: 0 × 0123456789 ABCDEF

Signed number:

Numerical value is close to but not actually mathematical base-two. The low-order bit
is 1, next 2, then 4 and so forth as in pure binary. But signed numbers are represented in
two-complement notation. The highest order bit is a sign bit which makes the quantity
negative and every negative umber can be obtained from the corresponding positive value by
inverting all the bits and adding one. This is why integers on a 64-bit machine have the
range−263 ¿263−1 . That 64th bit is being used for sign: 0 mean a positive number or zero, 1 is
a negative number. Some computer languages give you access to unsigned arithmetic which
is straight base 2 with zero and positive numbers only.

Big endian & little endian:

Little and big endian are two ways of storing multibyte data-types (int, float etc.). In
little endian machines, last byte of binary representation of the multibyte data-type is stored
first. On the other hand, in big endian machines, first byte of binary representation of the
multibyte data-type is stored first.

¿ big endian( 0× 01 , 0× 23 , …)

01 23 45 67 89 AB CD EF

MATH-206 Mr. Ihsan-ul-Ghafoor Page 2


Program language for Mathematicians
¿ little endian(0 × 01 ,0 × 23 ,…)

EF CD AB 89 67 45 23 01

Double precision representation (64-bit word):

It is a format given by IEEE for representation of floating point number. It occupies 64 bits
in computer memory

11bits 52 bits

Sign bit Exponent bit Mantissa fraction


Sign = 1-bit, Exponent = 11-bit, Mantissa = 52-bit
 Instead of signed exponent, E, the value actually stored in the exponent filed is
E' =E ( scaling factor )+ Bias ( 1023 )
 Here Bias is 1023, so it is known as excess-1023 format.
Example:
Represent 1259.12510 in double precision format.
Solution:
Step 1:
Convert decimal number in to binary
1259=100 1110 1011
0.125=0.001
Binary number=10 0 1 11 0 1 01 1+0. 0 0 1=1 0 01 1 10 1 0 11. 0 0 1
Step 2:
Normalize the number
1 0 0 11 10 1 0 11. 0 0 1=1. 0 0 11 1 01 0 11 0 0 1 ×210
Step 3:
Here S=0 (because given number is positive)
E=10 (Exponent)
M =0 0 1 11 0 1 01 1 0 01
Bias for a double precision format=1023
E' =E+ 1023=10+1023=103310=( 1 0 0 0 0 0 01 0 0 1 )2
Number in double precision format is given:
64 63 52 510
1 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 1 ..... 0 0 0

Sign bit Exponent Mantissa

Note: The procedure of storing whole number & integers etc is same

MATH-206 Mr. Ihsan-ul-Ghafoor Page 3


Program language for Mathematicians

You might also like