#Nice Little 4 Byte Memory

46 messages Β· Page 1 of 1 (latest)

rancid coyote
#

I just wanted to share this since I found the layout quite satisfying for the 4-byte memory level πŸ™‚

split fossil
#

It's surprising how many people have a problem to fit it, and you have a lot of space left, even with extra elements πŸ˜‰

pearl nebula
#

Please remeber to mark level solutions as spoilers

rancid coyote
rancid coyote
#

@split fossil I've managed to shrink it a bit by ||using an adder to take care of some of the logic|| however, I can't help thinking that ||I don't need 8 switches||

split fossil
#

Yep, the ||switches|| are a good direction.

pallid python
rancid coyote
frozen root
#

also worth remembering that when reading Z you get OFF so there's no way to interpret Z as data

rancid coyote
#

I think I've managed to get it close to optimal - 12 placed components and a fair amount of empty space πŸ™‚

pallid python
# rancid coyote

There is a more efficient 2-bit decoder that doesn’t need an adder.

frozen root
#

But uses the same amount of components

#

first of all, reconsider the way to detect OFFOFF and ONON

rancid coyote
frozen root
pallid python
frozen root
#

and so, because the minimal is 4 gates, the other 2 should somehow depend on these 2 because no gate would give us the correct output on its own

rancid coyote
#

I'm completely lost here πŸ˜‚

pallid python
#

Think about how sometimes a more complex expression (and double use of values) can simplify to a more simple expression, like ((a or b) or a) = a or b.

rancid coyote
#

Okay I think I'm getting somewhere, I'm working on a K-Map with 4 inputs (Load, Save, Address 1, Address 2) and 8 outputs (Memory 1 Read, Memory 1 Write, ... Memory 4 Write). I'm already seeing a lot of re-use in the boolean expressions being generated from it.

rancid coyote
#

It uses ||2 not gates, 8 logic gates, 4 memory modules||

pallid python
#

This part can be done in four components. (And basic gates at that.) || But as mentioned, it’s builds simple expressions from more complex two-use-value expressions. ||

bold pendant
#

This is ||the same circuit in Instruction decoder, you may find it easier to focus on just this in that level||.

rancid coyote
#

I guess I've been || focusing on selecting the memory on the "input" side of things, but I could also focus on selecting the correct "output", or a combination of the two||

rancid coyote
# pallid python This part can be done in four components. (And basic gates at that.) || But as m...

I don't know why I'm struggling with this so much. I can't see any possible way of doing this with four simple gates? (Assuming by gate you mean: AND/OR/NOT/NOR/XOR/XNOR, and not decoders, adders etc.)

Memory 1/2/3/4 = Q1/2/3/4
Address 1/2 = I1/2

Q1 = ~I1 AND ~I2 = ~(I1 OR I2) = ~(~I1 NAND ~I2) = I1 NOR I2
Q2 = ~I1 AND I2 = ~(I1 OR ~I2) = ~(~I1 NAND I2) = I1 NOR ~I2
Q3 = I1 AND ~I2 = ~(~I1 OR I2) = ~(I1 NAND ~I2) = ~I1 NOR I2
Q4 = I1 AND I2 = ~(~I1 OR ~I2) = ~(I1 NAND I2) = ~I1 NOR ~I2

I don't see any common terms that can be reused?

pearl nebula
#

You already know 2 of the 4 gates

#

solve the other two outputs you need using 1 gate each, only taking as input the original 2 inputs and the 2 gates you already know (No NOT)

rancid coyote
#

Ah okay - let me substitute that in. Thank you very much for your help by the way πŸ™‚

#
I1 I2 Q1 Q4 | Q2 Q3
------------+------
0  0  0  0  | X  X
0  0  0  1  | X  X
0  0  1  0  | 0  0
0  0  1  1  | X  X
0  1  0  0  | 1  0
0  1  0  1  | X  X
0  1  1  0  | X  X
0  1  1  1  | X  X
1  0  0  0  | 0  1
1  0  0  1  | X  X
1  0  1  0  | X  X
1  0  1  1  | X  X
1  1  0  0  | X  X
1  1  0  1  | 0  0
1  1  1  0  | X  X
1  1  1  1  | X  X
bold pendant
#

Why the X's? Q2 and Q3 need to be defined for all possible inputs. Nevermind I think I get it.

rancid coyote
#

By definition, Q1 = ~I1 AND ~I2, so the first row isn't possible since I1, I2 and Q1 are all 0

bold pendant
#

Yeah, I was a bit slow there πŸ™‚

rancid coyote
#

||```
Q2
I1I2\Q1Q4 00 01 11 10
00 X X X 0
01 1 X X X
11 X 0 X X
10 0 X X X

Q2 = ~I1 AND I2 = ~I1 AND ~Q1 = ~(I1 OR Q1) = I1 NOR Q1

Q3
I1I2\Q1Q4 00 01 11 10
00 X X X 0
01 0 X X X
11 X 0 X X
10 1 X X X

Q3 = I1 AND ~I2 = ~I2 AND ~Q1 = ~(I2 OR Q1) = I2 NOR Q1

#

Ahhh I think I see!

#

Let me add spoiler tags to this one

#

Ahh I got it! Thank you! Thank you! Thank you! πŸ™‚

#

So this is interesting - it's not something the K-Map technique would pick up on

#

Are there more sophisticated techniques that can make use of these intermediate results?

#

I think I've got it now πŸ™‚

This uses: || 4 logic gates, 4 switches, 4 memory modules||

unique otter
#

so like even when you use like 8 3 input and gates its still pretty easy

#

just dont use those nodes in the middle of lines

#

they make stuff prettier