EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Is that integer size would be differ for every 16bit, 32bit controller??

Is that integer size would be differ for every 16bit, 32bit controller??

|

Microcontroller › 8051 › Is that integer size would be differ for every 16bit, 32bit controller??

  • This topic has 2 replies, 3 voices, and was last updated 9 years, 11 months ago by Ashutosh Bhatt.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • June 11, 2015 at 6:19 pm #3709
    gokul sridhar
    Participant

    Is that integer size would be differ for every 16bit, 32bit controller

    Int   x;

    Is that now x will occupy different size in 16 bit,32 bit ??

    Then what about the short int, long int,double, — All vary on architecture of controller ??

    If we need to perform some 32 bit operations in 16 bit controller, how to do ??

    i think int take a single word size of the controller(if 8 bit — 8, 16 bit — 16 bit), 

    I am so confused. kindly answer me with clear data(if possible example)

     

    Thanks in Advance

    Gokul

     

     

     

     

    June 15, 2015 at 4:28 am #12985
    Prabakaran P M
    Participant

    For your first question my answer is yes.

    For doing 32bit operation in 16 bit controller you can use double int are manually create a library which will do 32bit operations using 16bit instructions.

    Mainly integer size is based on the compilers it will vary according to the compilers. Assume two different compilers can have different int size for a same microcontroller and vice versa.

    you have to see the types defined in stdint.h, or otherwise gothrough the documentation of the compiler.

    June 17, 2015 at 6:49 am #12990
    Ashutosh Bhatt
    Participant

    in most of the cross compilers int type data is always taken as 32 bit same as C compiler.

    the varients in int type are

    short int, long int, unsigned int, unsigned short int etc

    the occupy different widths

     

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • how to work on pcbs that are thick May 19, 2025
  • 100uF bypass Caps? May 19, 2025
  • Fuel Auto Shutoff May 18, 2025
  • Actin group needed for effective PCB software tutorials May 18, 2025
  • compatible eth ports for laptop May 18, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise