开发者

Breaking down a binary number into 4 digits?

I need to break down a binary number into 4 decimal digits using assemb开发者_运维百科ly.

For example, break down 0010 0110 1001 0010 which is 9874 into '9' '8' '7' '4' and show each on a 7-segment display. I got that display part, I just don't understand the logic/process of breaking it down.

Can anyone help please?

Thanks!


divide by 10, capturing the remainder. (modulus operation). Push the remainder onto a stack or other suitable structure. Repeat until the quotient is zero. The remainders that you pushed are the digit values.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜