256-byte DDR RAM
!!!Test, may work incorrectly.
Capacity: 256x8 bits
Maximum clock rate: 50hz (high physics); 400hz (high physics, slow-motion mode)
If "wrt" button is enabled it will write data input (buttons 0-7) into memory at specified address (buttons 10-17 (i.e. a0-a7)).
If "wrt" button is disabled it will get data from specified address and display it using buttons 0-7.
Both operations (read and write) will be executed both on rising and falling edges of clock cycle, i.e. every time you switch "clk" button.
It have shape of DIP-18 package just for fun, if you need to actually use it you will need to rescale it using fine tuner or something like that.
If you're trying to get it to work faster than pfps/2 and something went wrong it's your and only your problem.
Send comments about any other bugs|errors you get.
Specifications
Spotlights
- PlaneFlightX 2.7 years ago
- SnoWFLakE0s 2.7 years ago
General Characteristics
- Predecessor DIP-b DDR RAM 16x8
- Created On Windows
- Wingspan 1.6ft (0.5m)
- Length 1.6ft (0.5m)
- Height 5.8ft (1.8m)
- Empty Weight 22lbs (10kg)
- Loaded Weight 22lbs (10kg)
Performance
- Wing Loading N/A
- Wing Area 0.0ft2 (0.0m2)
- Drag Points 10
Parts
- Number of Parts 23
- Control Surfaces 0
- Performance Cost 71
@U2
To store value select address (buttons a0...a7), select value (buttons 0...7), enable wrt button, switch clk button.
To read value select address (buttons a0...a7), disable wrt button, switch clk button.
How do I use this
Epic
wow it very cool
@JuanShot2Go
I modified it a bit, so now it looks like that:
if(abs(rate(clk))){
addr=ai0+ 2*ai1+ 4*ai2+ 8*ai3+ 16*ai4+ 32*ai5+ 64*ai6+ 128*ai7
if(wrt){di=di0+ 2*di1+ 4*di2+ 8*di3+ 16*di4+ 32*di5+ 64*di6+ 128*di7}
}
addrLarge=floor(addr/3)
addrShift=pow(256,repeat(addr,3))
if(addrLarge=0){
if(di>=0){m0=m0-(repeat(m0,256*addrShift)-repeat(m0,addrShift))+di*addrShift}
value=floor(repeat(m0/addrShift,256))
}
if(addrLarge=
N){
if(di>=0){m
N=m
N-(repeat(m
N,256*addrShift)-repeat(m
N,addrShift))+repeat(di,256)*addrShift}
value=floor(repeat(m
N/addrShift,256))
}
di=-1
.
If
clk
was switched, buttonsai0
...ai7
will be used as new address (each button is one bit,ai0
is least-significant one).If
clk
was switched andwrt
is true, buttonsdi0
...di7
will be used as data to store (each button is one bit,di0
is least-significant one).addrLarge is number of memory variable that contains selected address. It's 1//3 of address, because single-precision floating-point format stores 23 fraction bits and one implicit leading bit, and 24/8 is 3, i.e. it can store up to 3 bytes (not including exponent and sign).
To store 3x8 bits in one 24-bit variable without intersection we need to shift it, but FT doesn't have any bitwise operators. So to shift value by N bits we need to multiply it by 2^N. Offset that we need to get is
repeat(addr,3)
bytes (see previous line), i.e. to store value in clean memory variable at Nth byte we need to addvalue*pow(2,8*repeat(addr,3))
(it's equal tovalue*pow(256,repeat(addr,3))
) to memory variable.To clear a byte of memory variable it uses
m-(repeat(m,256*addrShift)-repeat(m,addrShift))
. i wrote it 3 months ago and i don't remember how it works, but looks like it works.value
setter shifts memory variable and then usesrepeat(...,256)
to cut anything that's above 7th bit andfloor(...)
to cut anything that's below 0th bit.In programming languages like CS and Python we can create array named
m
and then get Nth element of array withm[N]
, but FT doesn't have arrays. So instead it uses pseudo-array, that's a lot of variables namedmN
and separate setters for each one.After it's used
di
sets to -1, and it will contain -1 as long asclk
will not be switched (see 7 lines above). Ifdi<0
,mN
setter will not be activated, and therefore memory contents will not be changed.Finally, if
clk
was switched andwrt
is false, buttonsdi0
...di7
is used to display separate bits ofvalue
that was previously obtained from one of memory variables (see 3 lines above)(didn't wrote it in code above because of comment length limit).Dude, I seriously want to understand this.