Breaking News
User Rank
Author
re: Gray Code Fundamentals – Part 2
6/9/2011 5:57:47 PM
NO RATINGS
Regarding the gray code counter, I found it easiest to use a "toggle" flip flop. The next state equations for an n-bit counter were: ns(i) := (not cs(0)) and (not cs(1)) and ... (not cs(i-2)) and cs(i-1) and (not cs(i) xor cs(i+1) xor ... cs(n-1)) I believe that the gray code counter will always be larger (binary counter toggle enable is simply an AND of all of the lower bits), use more power and be more difficult to debug. We always use binary counters and convert when we need. BTW: make sure your converted signals are registered if they cross any clock domains, otherwise you loose the benefit of gray code. Dave Simpson

User Rank
Author
re: Gray Code Fundamentals – Part 2
6/17/2011 7:31:03 PM
NO RATINGS
It may be easier for you to implement Gray counters with T-FF but for fully optimized equations that would not be the case. A good deal of it depends upon the native FF's available (T-FF's are usually permutations of native D or JK). From a logic point of view T's are easy, you write equations for when to change so MSB's are easy and narrow equations while LSB's are complex wide equations. Generally speaking JK's work best for logic reduction because they can essentially function as both D and T with many don't care states. As for power, there are two components, static power is process controlled while dynamic power is a linear function of toggles. Since a full sequence Gray counter asymptotically approaches 2 very quickly it's reasonable to say that they take half the power of a binary counter. For a full sequence Gray counter of n bits there are 2^n toggles while for a binary counter there are (2^(n+1))-2. Or to list binary power cost relative to Gray for n bits 2 through 8: 1.500, 1.750, 1.875, 1.938, 1.969, 1.984, 1.992 respectively.

User Rank
Author
How to convert BCD to Gray Code using sequential circuirt
2/15/2014 7:35:00 PM
NO RATINGS
Hi Clive for yours interesting posts.  I hope it would be in a better position to help. I am  a final year engineering student and I am to design a sequential circuit which converts BCD to Gray code. Hope you will be able to help.

User Rank
Author
Re: How to convert BCD to Gray Code using sequential circuirt
2/16/2014 12:13:18 PM
NO RATINGS
@BSc Student: I am to design a sequential circuit which converts BCD to Gray code. Hope you will be able to help.

This is easy-peasy -- check out this blog -- here's the code:

DEC   BIN     GRAY

0    0000    0000

1    0001    0001

2    0010    0011

3    0011    0010

4    0100    0110

5    0101    1110

6    0110    1010

7    0111    1011

8    1000    1001

9    1001    1000

Tra Da!

User Rank
Author
Re: How to convert BCD to Gray Code using sequential circuirt
2/16/2014 5:55:28 PM
NO RATINGS
Thanx Max. I know the code but iam a bit stuck on how to derive the state map for the conversion which i would then use to design the sequeantial circuit.

User Rank
Author
Re: How to convert BCD to Gray Code using sequential circuirt
2/17/2014 11:04:35 AM
NO RATINGS
@BSc Student: i am a bit stuck on how to derive the state map for the conversion which i would then use to design the sequeantial circuit.

I think there are two things here. let's say you have four registers that are used to hole your BCD count. Let's call them b3, b2, b1, and b0. So the first thing you need is a block of combinatorial logic in the feedback path to generate the next BCD value in the count sequence.

That is, you take the outputs from b3, b2, b1, and b0, feed them into your block of logic, and use the outputs from this logic to drive the inputs to your registers, so every time you get a clock pulse the BCD counter counts.

The next thing you need is another block of combinatorial logic that takes the outputs from the b3, b2, b1, and b0 registers and generates your 4-bit Gray code -- let's call these bits g3, g2, g1, and g0.

Take a look at my table -- let's start with g0. The only times this is a 1 corresponds to the BCD states of 1, 2, 7, and 8 (0001, 0010, 0111, and 1000). So we can say:

g0 = (!b3 & !b2 & !b1 & b0) | (!b3 & !b2 & b1 &!b0) | (!b3 & b2 &b1 & b0) | (b3 & !b2 & !b1 & !b0);

We would do the same thing for the other three Gray code bits (and we'd use the same technique to generate the next count value for the BCD feedback path).

Then use standard logic minimization techniques (like Karnaugh maps) to make the logic as small as possible.

I hope this helps. Let me know how you get on. Happy Monday! :-)

Datasheets.com Parts Search

185 million searchable parts (please enter a part number or hit search to begin)
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More

March 28 is Arduino Day -- Break Out the Party Hats! 7 comments
Well, here's a bit of a conundrum. I just received an email from my chum David Ashton who hails from the "Unfinished Continent" Down Under. David's message was short and sweet; all he said ...

latest comment David Ashton

A Book For All Reasons 1 Comment
Robert Oshana's recent book "Software Engineering for Embedded Systems (Newnes/Elsevier)," written and edited with Mark Kraeling, is a 'book for all reasons.' At almost 1,200 pages, it ...

latest comment mjlinden

Leonard Nimoy, We'll Miss you 5 comments
Like many of you, I was saddened to hear the news of Leonard Nimoy's death. His Star Trek character Mr. Spock was an inspiration to many of us who entered technical fields.

latest comment mhrackin

As every developer knows, there are the paper specifications for a product design, and then there are the real requirements. The paper specs are dry, bland, and rigidly numeric, making ...

latest comment MWagner_MA
Special Video Section
After a four-year absence, Infineon returns to Mobile World ...
6:23
A laptop’s 65-watt adapter can be made 6 times smaller and ...
2:01
An industry network should have device and data security at ...
0:50
The LTC2975 is a four-channel PMBus Power System Manager ...
5:06
In this video, a new high speed CMOS output comparator ...
6:11
The LT8640 is a 42V, 5A synchronous step-down regulator ...
5:52
The LTC2000 high-speed DAC has low noise and excellent ...
5:14
How do you protect the load and ensure output continues to ...
6:54
General-purpose DACs have applications in instrumentation, ...
7:34
Linear Technology demonstrates its latest measurement ...
10:29
Demos from Maxim Integrated at Electronica 2014 show ...
4:17
Bosch CEO Stefan Finkbeiner shows off latest combo and ...
5:59
STMicroelectronics demoed this simple gesture control ...
2:15
Keysight shows you what signals lurk in real-time at 510MHz ...
4:17
TE Connectivity's clear-plastic, full-size model car shows ...
3:42
Why culture makes Linear Tech a winner.
6:08
Recently formed Architects of Modern Power consortium ...
6:39
Specially modified Corvette C7 Stingray responds to ex Indy ...
8:52
Avago’s ACPL-K30T is the first solid-state driver qualified ...
2:42
NXP launches its line of multi-gate, multifunction, ...
4:56