Comsats University Islamabad, Attock Campus: Assignment No.2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

COMSATS UNIVERSITY ISLAMABAD,

ATTOCK CAMPUS

Assignment No.2
Course:
INTRODUCTION TO ICT
Submitted to:
UMAIR KHAN
Submitted by:
MARWA KHAN
CIIT/FA17-BCS-077/ATK
Section:
BSCS – 1B
Date of Submission:
19- OCTOBER- 2019
Question no#4;
4096 Byte of RAM is accessed by CPU, given that each location of 1 Byte, how many address
lines would be needed to access the entire memory block.What will be first and last address of
memory in binary, hexa & octa.

Solution:
Address Bus = 12 bits

The first memory address is = 0

The last memory address is = 4095 AS (2^n -1 = 2^12 – 1= 4096-1 = 4095) where n=12

Conversion to Binary;
2048 1024 512 256 128 64 32 16 8 4 2 1 Decimal
1 1 1 1 1 1 1 1 1 1 1 1 Binary
So binary = (111111111111)2
Conversion to Octa;
111 111 111 111 Making pairs of 3
bits for octa
7 7 7 7 Octal
So octa = (7777)8

Conversion to Hexa decimal;


1111 1111 1111 Making pairs of 4 bits
for hexa
F F F Hexa decimal
So Hexa =(FFF)16 where F=15

ROUGH WORK
Question no#2
Convert (32767.4712)8 to Binary, decimal & Hexadecimal.

Solution:
Conversion to Binary;

Converting each digit of Octa into binary by making pairs of 3 bits

3 2 7 6 7 . 4 7 1 2 Octal
011 010 111 110 111 . 100 111 001 010 Binary

So Binary = (011010111110111.100111001010)2

Conversion to Hexadecimal;

Making pairs of 4 bits for hexa

0011 0101 1111 0111 . 1001 1100 1010 Binary


3 5 F 7 . 9 C A hexa

So Hexa = (35F7.9CA) 16

Conversion to Decimal;

Integral part:
011010111110111=0+(1*213)+(1*212)+0+(1*210)+0+(1*28)+(1*27)+(1*26)+(1*25)+(1*24)+0+(1*22)+(1*21)+
(1*20)

=0+8192+4096+0+1024+0+256+128+64+32+16+4+2+1

= (13815)10

Fractional part:
.100111001010 = (1*2-1)+0+0+(1*2-4)+(1*2-5)+(1*2-6)+0+0+(1*2-9)+0+(1*2-11)+0

=(1/2)+(1/16)+(1/32)+(1/64)+(1/512)+(1/2048)

= (61181640625)10

So combination of integral and fractional is;

= (13815.61181640625)10
ROUGH WORK

You might also like