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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:19:48+00:00 2026-05-11T15:19:48+00:00

Can someone explain to me how division in MIX (from TAOCP by Knuth) works

  • 0

Can someone explain to me how division in MIX (from TAOCP by Knuth) works on a byte-to-byte basis?

rA = |-| . . . .0|   rX = |+|1235|0|3|1| 

The memory location 1000 contains |-|0|0|0|2|0|.

When you execute the operation

DIV 1000 

the registers become

rA = |+|0|617|?|?|  rX = |-|0|0|0|?|1| 

Now I understand the signs on rA and rX, but in what order are the bytes of rAX filled and which divisions are done?

If DIV 1000 leads to every bit divided by 2, then I would expect

rAX = |+|617|0|1|0|-|0|1|0|1|1|  

in which rA contains the division results and rX the remainders (filled from the right side).

I’m probaly missing something here, and Knuth seems to think I should be able to figure it out myself (hence the level 10 questions about it, which I also don’t get), but could someone help me out here?

  • 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. 2026-05-11T15:19:49+00:00Added an answer on May 11, 2026 at 3:19 pm

    So I kind of figured it out myself.

    If you do the division by hand, by converting the bytes into a single number you will get -210,501,825 (if you’re using the smallest kind of byte – which is 6 bits (!) in Knuths book). Divide this by -128, which is the value in location 1000 using the same bytesize.

    The quotient is 1644545, the remainder 65, the sign will be postive since both numbers are negative. If you store 1644545 in rA and 65 in rX, you will get

    |+|0|6|17|32|01| |-|0|0|0|1|1| 

    using the smallest bytesize (which holds 64 numbers). Since Knuth never assumes a particular bytesize in his examples, rX has a number of question marks. The sign of rX is always the previous sign of rA.

    Edit: I used the very handy MixEmul utilty to play around with the registers of MIX. This is a pretty nice MIX implementation done in .NET

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

Sidebar

Related Questions

Can someone explain me why this works: select val1, val2, count(case when table2.someID in
Can someone explain how the organisation of classes in Pharo works in different versions
Can someone explain in English how does Non-Recursive merge sort works ? Thanks
Can someone explain the following code.. What will that return statement do. public byte[]
Can someone explain me why with that query: SELECT * FROM `tags` WHERE (tag
Can someone explain what this excerpt from Single Page Apps in Depth means? A
Can someone explain what the method seed does from module random in the following
Can someone explain to me why this works just fine with in.available()>0 commented out,
Can someone explain meaning and difference of keep function from simple map(array, fun) var
Can someone explain this simple, yet deceiving, anomaly? There are two models, where B

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.