Here you can ask questions and find or give answers to organizational, academic and other questions about studying computer science.

925 questions

1k answers

1.4k comments

441 users

+1 vote
In the exam WS17 of DiRa number 2b they encode 33 to <[0,2,0,1]>4 and 39 (before flipping and +1) into <[0,2,1,3]>4. My question here is, when do I write the 0 at the beginning? Encoding 33 in my case would be:

33=8*4+1

8=2*4+0

2=0*4+  2
in * Other Teaching Fields by (200 points)

1 Answer

+1 vote

The radix-10 number <[33]>10 is 33 in decimal and it is the radix-4 number <[201]>4. Radix-B numbers never need leading zeros unless you have to extend them to a certain number of digits. Leading zeros don't change the value of Radix-B numbers.

However, 33 in decimal is the 4-complement number <[0201]>4. Here, we need a leading zero, since otherwise, the number <[201]>4 would be -31. With 4-complement numbers leading digits 0,1 denote non-negative numbers, and leading digits 2,3 denote negative numbers.

by (143k points)

Related questions

0 votes
1 answer
asked Aug 21, 2020 in * Other Teaching Fields by Eichi (200 points)
+1 vote
1 answer
asked Aug 18, 2020 in * Other Teaching Fields by davidschulz (410 points)
0 votes
1 answer
asked Aug 22, 2020 in * Other Teaching Fields by davidschulz (410 points)
0 votes
1 answer
asked Aug 21, 2020 in * Other Teaching Fields by Eichi (200 points)
0 votes
1 answer
asked Aug 18, 2020 in * Other Teaching Fields by davidschulz (410 points)
Imprint | Privacy Policy
...