What is the length of unsigned int in 8-bit microcontroller?

Publisher:yunhuiLatest update time:2016-05-20 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Writing programs in C has nothing to do with how many bits the microcontroller has. If you define an int data, two bytes of memory will be allocated to it. So int data is 16 bits. Unsigned int data is an unsigned integer, and the highest bit does not represent the sign, so it starts from 0000,0000,0000,0000B------1111,1111,1111,1111B. That is, from 0x0000----0xffff. If converted to decimal, it is 0---65535. If it is only int type data, the highest bit represents the sign bit, 0 for positive numbers and 1 for negative numbers. At this time, this data represents from. 0x8000---0x7fff (note that the highest bit is the sign flag bit) After converting to decimal, it is. -32768---+32767. You can refer to standard C language books for the length of other data, for example, a char type data is generally 8 bits. A long int type data is usually 32 bits. And so on. These have nothing to do with the number of bits of the microcontroller itself.
Reference address:What is the length of unsigned int in 8-bit microcontroller?

Previous article:The running process of a program in a single chip microcomputer
Next article:MCU packaging, crystal oscillator circuit

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号