Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Logic Problem !

Status
Not open for further replies.

Elecman2000

New Member
Obtain a binary code to represent all base-6 digits so that the 5's complement is obtained by replacing 1's by 0's and 0's by 1's in the bits of the code ? A liitle help pls :)
 
Elecman2000,

Obtain a binary code to represent all base-6 digits so that the 5's complement is obtained by replacing 1's by 0's and 0's by 1's in the bits of the code ? A liitle help pls

Any constructive help I give you would enable to easily solve the problem, so I will just give you an explanatory solution.

By complement, you mean the diminished radix complement, don't you? Otherwise the problem cannot be solved. That means that when the diminished radix complement is added to the number, all the digits will be 5.

So what you have to do is go through all the digits from 0 through 5 and find a number, which when added to the base 6 digit will make it equal to five. Then just flip the bits of the number. Starting from 0, we discern that 5 needs to be added to 0 to make it five. Then flipping the bits of 5 we get 2. Therefore 2 (010) will represent 0 in the table below

Code:
  0----> 010
  1----> 011
  2----> 100
  3----> 101
  4----> 110
  5----> 111

Now to check it out. Take a number like 534 base 6. From the table above we write 111 101 110 for each digit. Now flipping the bits we get 000 010 001, which means 021 base 6. Therefore 021 is the 5's complement of 534 base 6.

Ratch
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top