Monthly Archives: September 2014


Represent (63.125)10 using IEEE 754 single and double precision representations – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS
Course Code : MCS-012
Course Title : Computer Organisation and Assembly Language Programming
Assignment Number : MCA (2)/012/Assign /2014-15
Maximum Marks : 100
Weightage : 25%

Explain the single precision floating point single IEEE 754 representation. Represent the number (63.125)10 using IEEE 754 single precision and double precision representations.precision

Single Precision

 

S stands for Sign (white color)

E stands for Exponent (yellow color)

N stands for Number (also called Mantissa or Significand) (green color)

 

0this Sign bit (1 bit)

1st to 8this Exponent bits (7 bits)

9thto 31this Exponent bits (24 bits)

Double Precision

 

S stands for Sign (white color)

E stands for Exponent (yellow color)

N stands for Number (also called Mantissa or Significand) (green color)

 

0this Sign bit (1 bit)

1st to 11this Exponent bits (10 bits)

12thto 63this Exponent bits (53 bits)

 

First of all to represent we have (63.125)10 using IEEE 754

Since number is a positive number

Sign bit is: 0

0

Now let’s work on Mantissa part

Convert 63 into binary form i.e 11111

Remaining is fraction part 0.125

Now we multiply fraction value with 2 till we get whole number 1 at the end.

Fraction_Precision

We reach 1 so we stop

Write number from top to bottom

We get 0.125 = 001

Number (63.125)10 = (11111.001)2

Convert Binary number to Exponent Form

11111.001 Will be 1.1111001 * 24

Discard 1.

Take 1111001 as Significand

Significand number = (1111001)2

Significand bits are:

1 1 1 1 0 0 1

 

Fill the Significand in the beginning

Rest all fills it with 0’s

We will have

Significand bits are:

1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

 

+4 is the Exponent

So we have to subtract it with 127

Exponent = 127+4=130

Exponent number (130)10 = (10000010)2

Discard overflow bit

Exponent bits are:

0 0 0 0 0 1 0

 

Note: we have to discard overflow bit since we have only 7 bits

 

 

For Double Precision Only Exponent

+4 is the Exponent

So we have to subtract it with 1023

Exponent = 1023+4=1027

Exponent number (1027)10 = (10000000011)2

Discard overflow bit

Exponent bits are:

0 0 0 0 0 0 0 0 1 1

 Note: we have to discard overflow bit since we have only 11 bits

Significand bits are:

1 1 1 1 0 0 1

Significand will only have a change in terms of Zero’s which are added at the end.

For single precision 23-7=16 Zero’s

For double precision 53-7=46 Zero’s

An 8 bit data 10110011 after transmission is received as 10010011. Explain how SEC code will detect and correct – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS

Course Code : MCS-012

Course Title : Computer Organisation and Assembly Language Programming

Assignment Number : MCA (2)/012/Assign /2014-15

Maximum Marks : 100

Weightage : 25%

 

An 8 bit data 10110011 after transmission is received as 10010011. Explain how SEC code will detect and correct this problem.

 

SEC means Single Error Correction

This if found in Hamming Error Correction Code

First find out the number parity bits in SEC Code

Formula:

2i – 1 >= N + i

where

i = number of parity bits in SEC Code

N = number of  bits in Data Word

 

In this case

N=8

i=?

So,

2i – 1 >= N + I                at  i=3

 

23 – 1 >= 8 + 3

7 >= 11 (Not True)

So,

2i – 1 >= N + I                at  i=4

 

24 – 1 >= 8 + 4

15 >= 12 (True)

Condition Satisfied.

 

 

Coorection bits (parity bits) are 4.

 

Parity bits are placed at 20  222  23                     i.e.   1 2 4 8          respectively

 

P1

P2

D1

P3

D2

D3

D4

P4

D5

D6

D7

D8

1

2

3

4

5

6

7

8

9

10

11

12

?

?

?

?

 

D1 D2 D3 D4 D5 D6 D7 D8 are the data sent and recd.

 

Before sending calculate Parity of  Data to be sent.

 

P1

P2

D1

P3

D2

D3

D4

P4

D5

D6

D7

D8

1

2

3

4

5

6

7

8

9

10

11

12

?

?

1

?

0

1

1

?

0

0

1

1

 

P1     =      ?        1        0        1        0        1

(Positions)  1        3        5        7        9        11

 

Starting Point will be after Parity position P1 i.e 2 and Take 1 Skip 1till the end of table data.

We get 10101

It’s even parity will be 1

 

P2     =      ?        1        1        1        0        1

(Positions)  2        3        6        7        10      11

 

Starting Point will be after Parity position P2 i.e 3 and Take 2 Skip 2 till the end of table data.

We get 11101

It’s even parity will be 0

 

P3     =      ?        0        1        1        1

(Positions)  4        5        6        7        12

 

Starting Point will be after Parity position P3 i.e 4 and Take 4 Skip 4 till the end of table data.

We get 0111

It’s even parity will be 1

 

P3     =      ?        0        0        1        1

(Positions)  8        9        10      11      12

 

Starting Point will be after Parity position P3 i.e 4 and Take 8 Skip 8 till the end of table data. (Note:- data ends before taking 8 elements.)

We get 0011

It’s even parity will be 0

 

We found all parity bits, we will fill in the table:-

 

P1

P2

D1

P3

D2

D3

D4

P4

D5

D6

D7

D8

1

2

3

4

5

6

7

8

9

10

11

12

1

0

1

1

0

1

1

0

0

0

1

1

 

Assuming all parity sent correctly

The 8-bit Sent Data = 1011 0011

The 8-bit Sent Data = 1001 0011

 

Check with parity bits, before that Create a new parity bit with new data

 

P1=   D1     D2     D4     D5     D7=   10101         even parity will be 1   - correct

P2=   D1     D3     D4     D6     D7=   10101         even parity will be 1   - incorrect

P3=   D2     D3     D4     D8=             10101         even parity will be 0   - incorrect

P4=   D5     D6     D7     D8=             10101         even parity will be 0   - correct

 

After Checking

We find that common data bit numbers are D3 & D4

But D4 is also present in P1that means error has been occurred in D3 only.

 By this we dectect error in D3 and Correct it by replacing it by 0 to 1.

Use a Karnaugh’s map to design an odd parity generator circuit for 4 input bits – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS
Course Code : MCS-012
Course Title : Computer Organisation and Assembly Language Programming
Assignment Number : MCA (2)/012/Assign /2014-15
Maximum Marks : 100
Weightage : 25%

 

Use a Karnaugh’s map to design an odd parity generator circuit for 4 input bits.

Before Designing we should know inputs which is 4

That means 24 = 16 Combinations of outputs

Inputs are represented as ABCD

Output is represented by F and some times termed as Function

 

Decimal

A

B

C

D

F (Function)

0

0

0

0

0

 

1

0

0

0

1

 

2

0

0

1

0

 

3

0

0

1

1

 

4

0

1

0

0

 

5

0

1

0

1

 

6

0

1

1

0

 

7

0

1

1

1

 

8

1

0

0

0

 

9

1

0

0

1

 

10

1

0

1

0

 

11

1

0

1

1

 

12

1

1

0

0

 

13

1

1

0

1

 

14

1

1

1

0

 

15

1

1

1

1

 

Before proceeding we should know what odd parity is for ABCD inputs?

There are two types of parity even parity and odd parity

The parity is 0 or 1 depending upon total numbers of 1s

If count of 1s is even number then even parity = 0 and odd parity = 1

Similarly If count of 1s is odd number then even parity = 1 and odd parity = 0

After Finding out odd parity for ABCD inputs

We have Table as:-

 

Decimal

A

B

C

D

F (Function)

0

0

0

0

0

1

1

0

0

0

1

0

2

0

0

1

0

0

3

0

0

1

1

1

4

0

1

0

0

0

5

0

1

0

1

1

6

0

1

1

0

1

7

0

1

1

1

0

8

1

0

0

0

0

9

1

0

0

1

1

10

1

0

1

0

1

11

1

0

1

1

0

12

1

1

0

0

1

13

1

1

0

1

0

14

1

1

1

0

0

15

1

1

1

1

1

 

It’s can also be written as F =Σ (0, 3, 5, 6, 9, 10, 12, 15)

Only the decimal number where we find 1’s is shown in the Bracket.

Final Equation:-

Kmap001

Convert string into “UTF 8” code – “DNS uses domains like .com, .au etc.”. – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS
Course Code : MCS-012
Course Title : Computer Organisation and Assembly Language Programming
Assignment Number : MCA (2)/012/Assign /2014-15
Maximum Marks : 100
Weightage : 25%

Convert the following string into equivalent “UTF 8” code – “DNS uses domains like .com, .au etc.”. Are these UTF 8 codes same as that used in ASCII?

 

UTF 8        Stands for   U – Universal Character Set

T – Transformation

F – Format

8 – 8-bits (28 =256 characters)

ASCII CODE table:-

ascii_code

To Convert:

DNS uses domains like .com, .au etc.

Codes:

 D=068 N=078 S=083 (space)=032 u=117 s=115 e=101 s=115  (space)=032 d=100 o=111 m=109 a=097 i=105 n=110 s=115  (space)=032 l=108 i=105 k=107 e=101  (space)=032 .(dot)=046 c=099 o=111 m=109 ,(comma)=044  (space)=032 .(dot)=046 a=097 u=117   (space)=032 e=101 t=116 c=099 .(dot)=046

Convert Hexadecimal: ABCD01 into Binary, Octal, Decimal – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS
Course Code : MCS-012
Course Title : Computer Organisation and Assembly Language Programming
Assignment Number : MCA (2)/012/Assign /2014-15
Maximum Marks : 100
Weightage : 25%

Convert the hexadecimal number: (ABCD01)16 into equivalent binary, octal and decimal.

The Base Value of Hexadecimal number is 16. The Table represents the value in decimal.

0

0

1

1

2

2

3

3

4

4

5

5

6

6

7

7

8

8

9

9

10

A

11

B

12

C

13

D

14

E

15

F

Any Hexadecimal number can be represented in the following format for converting to Decimal.

A*165 + B*164 + C*163 + D*162 + 0*161 + 1*160

 =10*165 + 11*164 + 12*163 + 13*162 + 0*161 + 1*160

=10*1048576 + 11*65536 + 12*4096 + 13*256 + 0*16 + 1*1

=10485760 + 720896 + 49152 + 3328 + 0 + 1

=10485760 + 720896 + 49152 + 3328 + 0 + 1

=11259137

 

 

Decimal-to-Binary:

 Converting can be found on this link http://www.wikihow.com/Convert-from-Decimal-to-Binary

Decimal-to-Octal:

Converting can be found on this link http://www.wikihow.com/Convert-from-Decimal-to-Octal

Evaluate 2’s complement of 9 bits including sign bit. iii) Add 124 and 132 – IGNOU MCA Assignment 2014 -15

MASTER OF COMPUTER APPLICATIONS
Course Code : MCS-012
Course Title : Computer Organisation and Assembly Language Programming
Assignment Number : MCA (2)/012/Assign /2014-15
Maximum Marks : 100
Weightage : 25%

Perform the following arithmetic operations:-

Using binary signed 2’s complement notation for integers. You may assume that the maximum size of integers is of 9 bits including the sign bit. (Please note that the numbers given here are in decimal notation).

i)                    Add – 256 and 206

ii)                  Subtract 224 from –99

iii)                Add 124 and 132

Please indicate the overflow if it occurs. Also write how you identify overflow.

 iii) Add 124 and 132

First, we have to represent the number in binary notation

The sign of a binary number is represented by 0 as plus and 1 as minus

Sign bit                                 8 -bits

0 / 1

 

Now, Binary value of the given number

+124 – 01111100

+132 – 10000100

 +124:-

Sign bit                                 8 -bits

0

0

1

1

1

1

1

0

0

+132:-

Sign bit                                 8 -bits

0

1

0

0

0

0

1

0

0

  +124:-

Sign bit                                 8 -bits

0

0

1

1

1

1

1

0

0

   +132:-

0

1

0

0

0

0

1

0

0

   +256 :-

 Carry bit

0

1

0

0

0

0

0

0

0

0

 

Overflow condition occured.

The magnitude has been overflowed into sign bit and sign into carry the given 8-bits are not sufficient for the result of the magnitude.

 

 

Evaluate 2’s complement of 9 bits including sign bit. ii) Subtract 224 from –99 – IGNOU MCA Assignment 2014 -15

MASTER OF COMPUTER APPLICATIONS
Course Code : MCS-012
Course Title : Computer Organisation and Assembly Language Programming
Assignment Number : MCA (2)/012/Assign /2014-15
Maximum Marks : 100
Weightage : 25%

Perform the following arithmetic operations:-

Using binary signed 2’s complement notation for integers. You may assume that the maximum size of integers is of 9 bits including the sign bit. (Please note that the numbers given here are in decimal notation).

i)                    Add – 256 and 206

ii)                  Subtract 224 from –99

iii)                Add 124 and 132

Please indicate the overflow if it occurs. Also write how you identify overflow.

ii) Subtract 224 from –99

First, we have to represent the number in binary notation

The sign of a binary number is represented by 0 as plus and 1 as minus

Sign bit                                 8 -bits

0 / 1

Now, Binary value of the given number

99 – 01100011

224 – 11100000

  -99 :-

Sign bit                                 8 -bits

1

0

1

1

0

0

0

1

1

   +224 :-

Sign bit                                 8 -bits

0

1

1

1

0

0

0

0

0

In Binary, Subtraction is not done directly it is done by taking a MINUS sign for a positive number.

For subtraction changing +224 to -224:-

   -224 :-

Sign bit                                 8 -bits

1

1

1

1

0

0

0

0

0

Now, covert it to signed 2’s complement notation:-

  -99 :-

Sign bit                                 8 -bits

1

1

0

0

1

1

1

0

1

   -224 :-

Sign bit                                 8 -bits

1

0

0

1

0

0

0

0

0

 

Simple trick to convert any binary value to its signed 2’s complement notation is Check for the first one (i.e. 1) in the magnitude of the number from Right to Left when you find it, Keep the number unchanged till one (i.e. 1) and remaining number reverse it by changing value from 0 to 1 and vice-verse.

  -99 :-

Sign bit                                 8 -bits

1

1

0

0

1

1

1

0

1

   -224 :-

1

0

0

1

0

0

0

0

0

   -323 :-

Carry bit

1

0

1

0

1

1

1

1

0

1

 

 

Overflow condition occured.

The magnitude has been overflowed into carry the given 8-bits are not sufficient for the result of the magnitude.

Evaluate 2’s complement of 9 bits including sign bit. i) Add – 256 and 206 – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS
Course Code : MCS-012
Course Title : Computer Organisation and Assembly Language Programming
Assignment Number : MCA (2)/012/Assign /2014-15
Maximum Marks : 100
Weightage : 25%

Perform the following arithmetic operations :-

using binary signed 2’s complement notation for integers. You may assume that the maximum size of integers is of 9 bits including the sign bit. (Please note that the numbers given here are in decimal notation).

i)                    Add – 256 and 206

ii)                  Subtract 224 from –99

iii)                Add 124 and 132

Please indicate the overflow if it occurs. Also write how you identify overflow.

i) Add – 256 and 206

First, we have to represent the number in binary notation

The sign of a binary number is represented by 0 as plus and 1 as minus

Sign bit                                 8 -bits

0 / 1

Now, Binary value of the given number

206 – 11001110

256 – 100000000

This number value is of more than 8-bits (i.e.9-bits) in signed 2’s complement notation also the value remains the same. Hence this number cannot fit inside it.

To add this numbers we will need one more bit, hence Addition not possible.