Seven Segment Decoder

Back to General discussions forum

zelevin     2022-10-08 16:40:15

Rodion:

a fun (and different!) problem; thanks!

There is one small issue with the description: the segments e and f are switched in the diagram. It should go, I believe:

 aaaaaa
f      b
f      b
f      b
 gggggg
e      c
e      c
e      c
 dddddd

The wikipedia article agrees with the schema above, as does the checker.

Cheers,

V.

P.S. Added my own solution to The Shredder Conundrum.

Rodion (admin)     2022-10-08 16:50:08
User avatar

Oh my, what a shame, surely they just follow clockwise pattern :))) thanks for quick hint, fixed!

gardengnome     2022-10-09 11:30:15
User avatar

To avoid frustration when solving, please take note of this: 'so use "intermediate" signals naming them with a letter and, optionally, single digit.'

Rodion (admin)     2022-10-09 18:11:19
User avatar

Mathias, sorry for this inconvenience. The line you suggested in emphasized in bold now.

It seems not difficult to make parser work with nested functions but I realized deduplication for them is necessary then and thought it is not needed...

However these are my first baby-steps in creating descriptive syntax for similar tasks (I hope I can come up with few more) so your objection is quite valuable and I'll try harder next time :)

BTW I'm a bit surprised already about results of 7 and 8. However, if I understand correctly, there is no simple way (and perhaps no any way at all) to prove is solution minimal or not yet?

gardengnome     2022-10-09 18:27:01
User avatar

Hi Rodion,

No need for any apology. Reading the problem statement carefully is part of the challenge, and I jumped ahead too fast. I just thought to point it out for others. And no need for nested functions; my issue was that I initially used longer names such as nx1 (for not x1) for the intermediate signals. The 7 chip answer isn’t the result of a complex optimisation algorithm but I rather used a pretty standard approach to reducing Boolean expressions. Did it manually, and then checked via python.

zelevin     2022-10-09 20:26:48

The eight chip solution is generated by an algorithm, using a couple of optimizations that I came up with when solving the problem manually. There are other, reasonably straightforward, ways to add more (automatic) optimization, but I doubt I'll have time to implement them.

Rodion (admin)     2022-10-09 21:20:39
User avatar

That's cool! I believe there are ready solutions for algorithmic optimizations (most probably they could be found among the set of tools used for programming programmable logic chips), but probably this is not the only way. I hope to check bit later (hopefully earlier than I'm retired) if describing this task in prolog may help...

CSFPython     2022-10-10 13:44:29

Thanks for another really entertaining problem. I was aware that Boolean Algebra can be used to solve problems like this but would have to spend some time learning the techniques in order to use it. I followed the same route as Vladimir and wrote a program to design the circuit. This was probably more fun than learning Boolean Algebra!

gardengnome     2022-10-14 14:11:32
User avatar

Just noticed: after the correction of the e and f segments in the diagram, the two examples next to it also need updating.

gardengnome     2022-10-22 18:21:00
User avatar

A self-reply to draw Rodion's attention to the previous post.

Rodion (admin)     2022-10-22 18:47:55
User avatar

Aha, that works :)

Thank you, Mathias :) I remember reading your note first time but slowpoking on what's wrong and then unluckily forgetting - Fixed now!

Please login and solve 5 problems to be able to post at forum