Subject:
|
converting binary to integer
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Wed, 4 Jun 1997 04:40:58 GMT
|
Original-From:
|
Keith the wonder wookie <KAS219@ihatespamPSU.EDU>
|
Viewed:
|
1369 times
|
| |
| |
I am reading four digital inputs and I need a way to convert those four
bits into a decimal number. Is there an easy way to do it. Thanks.
Keith
Keith Soldavin
kas219@email.psu.edu
http://www.personal.psu.edu/kas219/
|
|
Message has 1 Reply: | | Re: converting binary to integer
|
| (...) Multiply each bit by 2^n, where n is the "place" of the number. Then add the products together. For example... 1011 = 1*2^0 + 1*2^1 + 0*2^2 + 1*2^3 = 11 The "zero" place is the one furthest to the right, and you work left from there. ---...--- (...) (27 years ago, 4-Jun-97, to lugnet.robotics.handyboard)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|