Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8475757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:58:48+00:00 2026-06-10T17:58:48+00:00

How to convert the signed DWORD to Unsigned DWORD ? I have one method

  • 0

How to convert the signed DWORD to Unsigned DWORD ?

I have one method of doing which is Two’s complement.

But, when i did, compiler is giving an error that bitwise operation isnt allowed for signed numbers (as per the MISRA rule 2004 12th rule) .

so then how can i convert to unsigned Dword?

long int  num1,num2,
unsigned long int num3;

num1 = 293;
num2 = 296;

num3 = num1 - num2;

if i run the code then num3 is loaded with some 0xFFFFFFE somevalue like this.

but actually the desired value 3 should get store?

so i made the unsigned long int num3 to long int num3.

Then num3 signed value (-3 in this case) should be converted to 3 without doing twos complement?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:58:49+00:00Added an answer on June 10, 2026 at 5:58 pm

    The definition of the conversion from signed to unsigned is to take the
    modulus of the value, so that the results always correspond to what you
    would get by taking the raw bits on a two’s complement machine. But you
    don’t want to convert -3; you want to convert the distance, which is
    the absolute value of the difference: abs( num1 - num2 ).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a function to convert a 32bit or 24bit signed (in two's complement)
I have to convert bytes to signed/unsigned int or short. The methods below are
I got an array which contains signed int data, i need to convert each
Using C++, an int gets converted from "signed" to "unsigned". Can I convert this
I want to understand how to convert signed number into unsigned. lets say I
Scenario: I have a string of hexadecimal characters which encode 8-bit signed integers. Each
x86 does not have an SSE instruction to convert from unsigned int32 to floating
I am trying to convert 65529 from an unsigned int to a signed int
I have to convert a double value x into two integers as specified by
I want to subtract two signed 8bit integers in JavaScript. As JavaScript doesn't have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.