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 7444149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:26:55+00:00 2026-05-29T11:26:55+00:00

I was trying to set 46th bit in a register which of 64 bits

  • 0

I was trying to set 46th bit in a register which of 64 bits wide using C.How do i go about setting this bit ?

Currently i am doing this:

uint32_t= address ;
uint64_t data =1ULL << 46;

Printing this is showing that bit 14 is getting set.I am not able to set even bit 32. If i set bit 32 it sets bit 0. 33 will set bit 1. Looks like it is doing circular shifting after 0-31 again it starts over with 0.

Register in 64 bit wide.

Any idea how do i go about setting this bit ?

Eg:

reg_addr.val = FEATURE_REG;

printf(stdout, "Programming enable at address %x=%llx\n",
    reg_addr.val,reg_addr.val);

data.val = (1ULL << 46);

printf("Data value %llx\n",data.val);}
  • 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-05-29T11:26:57+00:00Added an answer on May 29, 2026 at 11:26 am

    If you use types as uint32_t or uint64_t printing correctly is done with:

    printf(stdout, "Programming enable at address %" PRIu32 "=%" PRIu64 "\n",reg_addr.addr, reg_addr.val);
    

    assuming reg_addr.addr is of type uint32_t and type reg_addr.val is of uint64_t.

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

Sidebar

Related Questions

Trying to set up the svn commit with trac using this script. It is
I am using mac lion and eclipse indigo. I am trying set it up
Trying to set this label to red I've got the following class: .redErrorText {
Trying to set up an extension method in .Net 3.0 using generics and I
I trying to set up Apache as proxy which will eventually rewrite requests for
Im trying to set active classes in a nav using php. Now I need
Trying to set an array and a count, which are both static members, by
Trying to set up a new spring project and im having this issue where
Currently trying to set up and deploy a Sencha Touch 2 application. I'm following
how i can input detailed information about errors? i was trying set customErrors mode

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.