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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:26:52+00:00 2026-05-23T18:26:52+00:00

While working on ruby I came across: > "cc".unpack(‘b8B8’) => ["11000110", "01100011"] Then I

  • 0

While working on ruby I came across:

> "cc".unpack('b8B8')
 => ["11000110", "01100011"] 

Then I tried Googleing to find a good answer on "least significant bit", but could not find any.

Anyone care to explain, or point me in the right direction where I can understand the difference between "LSB first" and "MSB first".

  • 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-23T18:26:53+00:00Added an answer on May 23, 2026 at 6:26 pm

    It has to do with the direction of the bits. Notice that in this example it’s unpacking two ascii “c” characters, and yet the bits are mirror images of each other. LSB means the rightmost (least-significant) bit is the first bit. MSB means the leftmost (most-significant) is the first bit.

    As a simple example, consider the number 5, which in “normal” (readable) binary looks like this:

    00000101
    

    The least significant bit is the rightmost 1, because that is the 2^0 position (or just plan 1). It doesn’t impact the value too much. The one next to it is the 2^1 position (or just plain 0 in this case), which is a bit more significant. The bit to its left (2^2 or just plain 4) is more significant still. So we say this is MSB notation because the most significant bit (2^7) comes first. If we change it to LSB, it simply becomes:

    10100000
    

    Easy right?

    (And yes, for all you hardware gurus out there I’m aware that this changes from one architecture to another depending on endianness, but this is a simple answer for a simple question)

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

Sidebar

Related Questions

While working on a project, I came across a JS-script created by a former
While working my way through the Android tutorials, I came across something I don't
I have been working on polishing my Ruby skills lately and came across a
I'm having a frustrating time with Rspec while working through the Ruby on Rails
I am working on an existing Ruby on Rails project. While one of the
I'm working on learning TDD while writing some small ruby programs. I have the
I came from non-computer-science background and Now I am working as a Ruby on
Have been working in Ruby for a while, but usually in the context of
While working in a Java app, I recently needed to assemble a comma-delimited list
While working between a Windows MySQL server and a Debian MySQL server, I noticed

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.