1,105,594 Community Members

Pep8 convert a 3-bit binary number to a decimal number

Member Avatar
goha1414
Newbie Poster
4 posts since Mar 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Write a program in object code that will convert a 3-bit binary number to a decimal number,For example, if input is 101, output should be 5; if input is 011, output should be 3. that is what I have to do,this is what I have so far but its not working, Can someone point out what is wrong or what need to be changed

49 00 30
D1 00 30
1C
F1 00 33
51 00 33
zz

Member Avatar
prvnkmr449
Junior Poster
113 posts since Sep 2010
Reputation Points: -8 [?]
Q&As Helped to Solve: 16 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi, I just want give u idea how to do that, try to convert my idea into code if it work for u then ok other wise post your work fo futher help...
See what all you have to do

step 1. binarynumber=101
step 2. rtmostdigit=101 mod 10
step 3. decimaldigit=rtmostdigit*2^0    (0,1,2 index of binary number)
step 4. binarynumber=binarynumber/10

I hope it will help you

Member Avatar
goha1414
Newbie Poster
4 posts since Mar 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks for the respond but I think we are talking about 2 different things, My code is already posted. I am writing the code in machine language using pep8 program, have you used it before?

Member Avatar
prvnkmr449
Junior Poster
113 posts since Sep 2010
Reputation Points: -8 [?]
Q&As Helped to Solve: 16 [?]
Skill Endorsements: 0 [?]
 
0
 

Sorry, Its an accedent, I did't see that your want help in machine language. I don't machine language so I can't help you may some ones else help you....

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: