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

  • Home
  • SEARCH
  • 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 995809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:46:48+00:00 2026-05-16T06:46:48+00:00

I was reading this document: http://www.fadden.com/techmisc/hdc/lesson11.htm In it he stated: Problem is, we don’t

  • 0

I was reading this document: http://www.fadden.com/techmisc/hdc/lesson11.htm

In it he stated:

Problem is, we don’t know how long
these are. So, we encode the length
with the unary coding we looked at
first (colons added for clarity):

 value     binary coding
 1         1:
 2         01:0
 3         01:1
 4         001:00
 5         001:01
 16        00001:0000
 64        0000001:000000
 256       000000001:00000000

This method is actually floor(log i)
zeros, followed by a 1, followed by
the binary code without the leading 1.
Since the first part is a unary count,
there is one ‘0’ for every bit in the
second part. This means we can
intersperse the data bits with the
zeros, like this:

 value     binary coding
 1         1
 2         001
 3         011
 4         00001
 5         00011
 16        000000001
 64        0000000000001
 256       00000000000000001

This has the same length, but can be
implemented with a simple shift
routine (assembly: shift left, if
carry set then exit, else shift the
next bit into the integer we’re
forming).

What exactly is this assembly shift and is it reversible, meaning can 00000000000000001 go back to 00000000100000000 without extra data?

An animation of an assembly shift would be excellent. Thanks

  • 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-16T06:46:49+00:00Added an answer on May 16, 2026 at 6:46 am

    It’s a bit shift operation, see for instance this Wikipedia article: http://en.wikipedia.org/wiki/Bit_shift#Bit_shifts

    The bits that get shifted out are usually not recoverable (except for rotate), so the operation is not reversible in itself. There are variants where, if you shift over just a single bit position, the value of the bit shifted out is saved in a flag register (the carry bit mentioned in your quote) where you can use it for a conditional jump.

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

Sidebar

Related Questions

I have the following xml: <config xmlns=http://www.someurl.com> <product> <brand> <content /> </brand> </product> </config>
I have installed PyQT from this URL: http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-Py2.6-gpl-4.7.7-1.exe I have Python 2.6 installed. My
I am reading DrRacket document http://docs.racket-lang.org/guide/binding.html There is a function (define f (lambda (append)
Reading this question I found this as (note the quotation marks) code to solve
Reading this post has left me wondering; are nightly builds ever better for a
Reading this blog post about HttpOnly cookies made me start thinking, is it possible
After reading this question , I was reminded of when I was taught Java
After reading this description of late static binding (LSB) I see pretty clearly what
After reading this answer: best way to pick a random subset from a collection?
After reading this discussion and this discussion about using CrashRpt to generate a crash

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.