Programme Code : MCA Course Code : mcs-031 | More Year : 2014 Views: 911 Submitted By : c p chetry On 16th March, 2014 Q. Suppose that instead of binary or decimal representation of integers, we have ternary, along with 3’s complement, representation of integers, i.e., integers are represented using three digits, viz., 0, 1,2. For example, the integer 47 is represented as 01202 = (in decimal) 1. 33 + 2. 32 + 0. 31 + 2. 30, where, the leading zero indicates positive sign. And the integer (– 47 ) in 3’s complement is represented by 11021, the leading 1 indicates negative sign. The other digits, except the right-most, in the representation of (– 47) are obtained by subtracting from 2 the corresponding digit in 47’s representation, and then adding 1 (the representation of – 47 is obtained as 11020 + 00001). Write a program for the arithmetic (negation of an integer, addition, subtraction and multiplication of two integers) of 4 integers using 3’s complement representation. The program should include a procedure for calculating each of negation of an integer, addition, subtraction and multiplication of two integers. The integers will use 8-ternary digit positions, in which the left-most position will be used for sign. Using your program find the ternary representation of each of the decimal numbers 345, -- 297, 18 and ( (345 -- 297) * 18) No Answer Found

All form fields are required.

 Name Email In above form fill your Name and Email Id. We will send an email when we solve it.