Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS401 Assignment # 2- Help needed
#1
Question_1: [marks: 10]
Find the 2’s complement of a number using bitwise logical operator.

Question_2: [marks: 10]
Take a random number of word (dw), form and input this to a subroutine “Is Number Power of Two”. Check number is in power of 2 using bitwise logical operators and then display the return result on the screen if the number is even it diplay that number is even if the number is odd then it display the number is odd.


Due date: 22-11-2010
Reply
#2
Kindly help in solving this assignment....please!
Reply
#3
Hi Anya,
i think today is bonus day for ur assignment..
i have gOt this little help that may help u ...as its not my subject but my brothers

so kindly...have a look


Below is the idea solution:
Q1.
Take a number and move in one variable like AX.
Use NOT to invert.
Add 1 to it.
Answer is 2.s complement,

Pseudo code:
move Ax, 10
Not AX
Add ax,1


Q2.
Use the examples in handoouts (print number + hello world).
write a sub routine to check for even or odd, if it it odd (divide by 2, if remainder in dx is not zero, it is odd), then exit from sub routine using ret, and display the result,
If number is even, the check for power of two. Algoeithim is divide the number by 2 untill divider is 1 and check for remainder dx using XOR. if remainder is 1 then it is not power of 2,

subriutine of clear screen
subroutine to display
subroutine to check even
move AX,10 ;number to check
move bx, 2
div bx,
cmp dx,0
jnz outofsequence
move AX,10 ;number to check
move bx, 2
div bx,
cmp bx,1
jmb mainloop
XOR bx, dx
cmp bx, 0
if not 0, number is not power of 2,
else number is power of 2,
ret main loop
call display in main loop

you need to use stack in your program too.


I hope now it will be easy to write the program.

best regards
Reply
#4
Good effort.
Reply
#5
cs 402 ki assingment ka soln post kr dain.it is third assingment.it is difficult 4 me
Reply
#6
where is your assignment i can not see your assignment
Reply
#7
cs402 solution

http://vuhelp.net/mcs/6247-cs402-theory-...011-a.html

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need ACC501 - Business Finance Assignment No 2 Solution. Umar Abbas 2 4,251 02-07-2014, 08:23 PM
Last Post: Umar Abbas
  sta301 assignment 4 27 jun bc110200090 6 3,580 01-26-2013, 02:05 AM
Last Post: Vuhelper
  cs506 2nd assignment millee 0 2,661 12-04-2012, 11:30 PM
Last Post: millee
  cs506 2nd Assignment Neelam Ahmad 5 3,130 12-04-2012, 11:24 PM
Last Post: Vuhelper
  CS 504 Assignment 2 need help ommmi 24 11,422 11-27-2012, 04:59 AM
Last Post: Xpert
  Mcs cs402 1st assignment chahat4all 2 3,767 11-01-2012, 11:11 PM
Last Post: chahat4all
  eng201 assignment 4 due date 4/7/2012 bc110200090 6 2,615 07-03-2012, 03:51 PM
Last Post: bc110200090
  need CS304 4th assignment shazma 0 2,056 06-26-2012, 12:48 PM
Last Post: shazma
  sta301 assignment 4 solution vudecent 0 2,399 06-25-2012, 01:51 AM
Last Post: vudecent
  Required Soluction for 3rd Assignment of CS101 bc120200426 1 2,138 06-14-2012, 04:13 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 2 Guest(s)