how does an 8bit MCU handle 16bit output? How does an 8bit MCU store values higher than 8bits? I am using an attiny, on an adafruit trinket. and other 8bit MCUs. http://www.atmel.com/devices/attiny85.aspx I was doing some things with uint32_t datatypes, when it hit me, that it would seem like uint32_t would be an incompatible datatype. Even 2Byte data type like int seems peculiar. "int stores a 16-bit (2-byte) value" considering the MCU is 8bit.
I saw this link, that sounded like it would have more info, but its pages are incomplete. http://playground.arduino.cc/Code/DatatypePractices
So how does that work? How does an 8bit MCU make use of data-types over 8bits?
2 Answers 2
The basic answer is that the processor does math in 8-bit chunks, so it takes more instructions than it would on a 32-bit processor.
A good answer is found in EE.SE
Actually a 1-bit MCU could be used to execute code (e.g. C/C++) with N-bit numbers. Not very fast as it will require O(N) operations for addition and subtraction.
To better understand this for the 8-bit AVR MCU used in Arduino I recommend reading the Instruction Set Description Manual, AVR/GCC Wiki and assembler code listings for some sketches. This will reveal the secret(s) behind this "alien technology/magic".
Cheers!
Explore related questions
See similar questions with these tags.
MCU
micro controller unit?