Minimum and maximum number of bits required....

Click For Summary
SUMMARY

The discussion centers on the minimum and maximum number of bits required for binary coding, specifically addressing the confusion around encoding distinct quantities. It clarifies that while a minimum number of bits is necessary to represent a set of values, there is no maximum limit on the bits used. The example of coding the decimal digit 6 is explored, highlighting that 0001000000 is an inefficient representation compared to 0000000110. Additionally, the use of 8-bit extended ASCII and 8-bit Gray coding is discussed, emphasizing their practical applications in sensor technology.

PREREQUISITES
  • Understanding of binary and decimal number systems
  • Familiarity with binary coding techniques
  • Knowledge of Gray coding and its applications
  • Basic concepts of digital electronics and switch sensing
NEXT STEPS
  • Research "Binary to Decimal conversion methods" for clarity on encoding
  • Explore "Gray coding" and its advantages in sensor applications
  • Study "Extended ASCII code" and its usage in data representation
  • Investigate "Switch sensing techniques" and their implementation in digital circuits
USEFUL FOR

This discussion is beneficial for computer scientists, electrical engineers, and anyone involved in digital systems design, particularly those working with binary coding and sensor technologies.

mooncrater
Messages
215
Reaction score
18

Homework Statement


Here is this line in my book which says, "Although the minimum number of bits required to code ##2^n## distinct quantities in n, there is no maximum number of bits that may be used for a binary code. For example, the ten decimal digits can be coded with ten bits, and each decimal digit assigned a bit combination of nine 0's and a 1. In this particular binary code, the digit 6 is assigned the bit combination 0001000000.

Homework Equations


A binary number like 1010 is changed to it's decimal form by:
##1*2^3+0*2^2+1*2^1+0*2^0##
which is equal to : ##10##

The Attempt at a Solution


So, in this particular case, the conversion is not clear to me. When we convert 0001000000 to decimal we'll get ##2^6## and not 6. We can get 6 through 0000000110 rather. So where am I wrong? Am I misunderstanding something?

Moon
 
Physics news on Phys.org
That second example 000100000 is not an example of the minimum encoding and therefore can not be converted binary<->decimal in the usual way.
It's a less efficient way of representing 10 quantities. Here there can only be one bit on at a time.

To convert such data to base 10 you have look at where the '1' bit is. It appears to be numbered from right to left: right most is 0, then 1, then 2 etc. The 6th is '1''. The bits could also be mapped to any of 10 quantities in any order.

The confusion may be that they state that this too is a "binary code". Not to be confused with "base 2" representation.
 
  • Like
Likes   Reactions: mooncrater
Okay! Thats just a different ( and non-efficient) way of representing numbers.
Thanks..:)
 
Just as riders.

I would think the most commonly used 8 bit code for 6 is 00110110, which is extended ASCII code.

You can make up any code you choose and in an IT context there are good reasons for doing it differently from the 'natural' binary code of maths. For example the 8 bit Gray coding for 6 is 00000101 and this code is a minimum encoding with only a single bit change for each increment, which is very useful in sensors for avoiding false values from switching transients.

The 10 bit code hinted at in the OP may be derided by mathematicians, but is again useful in switch sensing. Each switch state can be represented by one bit and which switch has been pressed is determined by the position of the 1. This code can be converted to mathematical binary - IC's are available which do it - but that can only work for one switch at a time. The inefficient 10 bit code can deal with any combination of switches being pressed at one time.
And if one wanted to show which button had been pressed on a seven segment display, the code for 6 would be 01011111 (or 01111101 )

Edit after new post:
"Thats just a different ( and non-efficient) way of representing numbers."
By efficiency in this context, presumably you mean the least number of bits of storage? Efficiency could mean ease of calculation, or ability to represent a large range of numbers, or maybe even ability to avoid errors.
 
Last edited:
  • Like
Likes   Reactions: nsaspook and mooncrater

Similar threads

Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K