How Many Bytes Does Float Occupy Inside PIC Microcontroller?

Click For Summary
SUMMARY

A variable of float data type occupies 4 bytes (32 bits) in the data memory of PIC microcontrollers. This size is consistent across various PIC architectures, including 12-bit, 13-bit, 14-bit, 16-bit, and 32-bit microcontrollers. However, floating-point operations may not be natively supported, and fixed-point techniques could be employed instead. Users should verify the specific PIC model's documentation for any nuances regarding floating-point handling.

PREREQUISITES
  • Understanding of PIC microcontroller architecture
  • Familiarity with data types in programming, specifically float
  • Basic knowledge of memory allocation in embedded systems
  • Awareness of fixed-point versus floating-point arithmetic
NEXT STEPS
  • Research PIC microcontroller documentation for specific models
  • Learn about fixed-point arithmetic techniques in embedded systems
  • Explore the differences between floating-point and fixed-point operations
  • Investigate the implications of data type sizes on memory management in embedded programming
USEFUL FOR

Embedded systems developers, students studying microcontroller programming, and engineers working with PIC microcontrollers who need to understand data type memory usage.

Abstr7ct
Messages
21
Reaction score
0

Homework Statement



How many bytes does a variable of float data type occupy in the data memory of PIC microcontroller?



Homework Equations



None


The Attempt at a Solution



All I know, is that float data type has a size of 4 bytes, that's 32 bits. I'm not sure if it occupies the same size inside the data memory of the PIC.
 
Physics news on Phys.org
Abstr7ct said:

Homework Statement



How many bytes does a variable of float data type occupy in the data memory of PIC microcontroller?



Homework Equations



None


The Attempt at a Solution



All I know, is that float data type has a size of 4 bytes, that's 32 bits. I'm not sure if it occupies the same size inside the data memory of the PIC.
There are many different kinds of PIC controllers, ranging from 12-bit, 13-bit, 14-bit, 16-bit, up to 32-bit wide code memory.

I looked at this wikipedia article, and didn't see any mention of floating point op codes, so perhaps floating point operations are done in a kind of fixed-point technique.

I don't have any experience with PIC microcontrollers - most of my assembly experience has been with various Intel x86 chips and some with Motorola 68000 family.
 

Similar threads

Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
10
Views
4K
  • · Replies 25 ·
Replies
25
Views
15K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
5
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
1
Views
2K