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 › PIC › Is that integer size would be differ for every 16bit,32bit controller

  • This topic has 1 reply, 2 voices, and was last updated 7 years, 3 months ago by GANEEV SINGH.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • June 11, 2015 at 6:16 pm #3708
    gokul sridhar
    Participant

    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

     

     

     

    March 21, 2018 at 7:11 am #14808
    GANEEV SINGH
    Participant

    Hi

    While coding if you make use of an integer variable then it's size will remain fixed, it will not change according to the microcontroller you use. Generally an unsigned it in allocated 4 bytes but what if you do not want that much space, well there is a provision in coding language to change the size of integer variable as per your requirements. 

    So If you want to store values in integer variable upto 8 bits you can initialize your variable by writing uint_8t variable_name. Similarly for for 16,32 and 64 bit variable you will initialize variable like: uint_16t, uint_32t and uint_64t respectively. For signed integer variables you can omit u in the begining.

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

RSS Recent Posts

  • Can I make two inputs from one?? July 9, 2025
  • The Analog Gods Hate Me July 9, 2025
  • How to make string LEDs? July 9, 2025
  • Fixing board, Easy question HEX SCHMITT July 9, 2025
  • It's Amazing What A Buck And A Quarter.... July 8, 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