Sponsored Links


Results 1 to 7 of 7

Thread: CS401 Assignment # 2- Help needed

  1. #1

    CS401 Assignment # 2- Help needed

    Sponsored Links1


    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.

    Sponsored Links


    Due date: 22-11-2010

  2. #2
    Kindly help in solving this assignment....please!

  3. #3
    Junior Member
    Join Date
    May 2010
    Posts
    4
    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

  4. #4

  5. #5
    Junior Member
    Join Date
    Apr 2011
    Posts
    26
    cs 402 ki assingment ka soln post kr dain.it is third assingment.it is difficult 4 me

  6. #6
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,239

    Icon8

    where is your assignment i can not see your assignment

  7. #7
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578
    cs402 solution

    http://vuhelp.net/mcs/6247-cs402-theory-automata-idea-solution-assignment-no-3-spring-june-2011-a.html

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. CS 504 Assignment 2 help needed
    By ommmi in forum BCS
    Replies: 1
    Last Post: 11-19-2012, 01:22 PM
  2. CS 506 assignment #1 help needed!
    By mt_sh in forum Get Solution In 24 Hour
    Replies: 10
    Last Post: 10-31-2011, 06:58 AM
  3. assignment needed MCM 310
    By Ali-k in forum Get Solution In 24 Hour
    Replies: 0
    Last Post: 06-07-2011, 04:42 PM
  4. CS502 assignment # 2-Help needed
    By Anya in forum Get Solution In 24 Hour
    Replies: 3
    Last Post: 11-28-2010, 02:21 AM
  5. MTh 301 and Mth 202 assignment solutions needed
    By Death race in forum Get Solution In 24 Hour
    Replies: 0
    Last Post: 07-16-2010, 11:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft