Questions

16 bit arithmatic in 8 bit ansi C

Tags: It employment, Software
+
0 Votes

16 bit arithmatic in 8 bit ansi C

TonyMorton
I have two 14 bit numbers held in 8 bit variables, upper 6 bits in one variable and lower 8 bits in another. My processor is only 8 bits. I need to compare the second number with the first and if it is larger I need to increase the first number by 1. If it is smaller I need to decrease the first number by 1. Exit if they are the same.

Member Answers