Remove this ad
avatar

Awesome Sauce

Survivalist
Fully Fledged

Posts: 284 Member Since: 26 December, 2014

Lead

26 June, 2017 23:05:45

Tags : : , ,

As a programmer, I thought that survivalcraft was lacking a few simple gates, which I have implemented with a simple memory bank.  I tested them a bit, so I hope them work!
Equals Gate (x == y):
F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F0000000000000000F
Greater Than Or Equal To Gate (x >= y) :
F000000000000000FF00000000000000FFF0000000000000FFFF000000000000FFFFF00000000000FFFFFF0000000000FFFFFFF000000000FFFFFFFF00000000FFFFFFFFF0000000FFFFFFFFFF000000FFFFFFFFFFF00000FFFFFFFFFFFF0000FFFFFFFFFFFFF000FFFFFFFFFFFFFF00FFFFFFFFFFFFFFF0FFFFFFFFFFFFFFFF
Greater Than Gate (x > y):
0000000000000000F000000000000000FF00000000000000FFF0000000000000FFFF000000000000FFFFF00000000000FFFFFF0000000000FFFFFFF000000000FFFFFFFF00000000FFFFFFFFF0000000FFFFFFFFFF000000FFFFFFFFFFF00000FFFFFFFFFFFF0000FFFFFFFFFFFFF000FFFFFFFFFFFFFF00FFFFFFFFFFFFFFF0
Less Than Or Equal To Gate (x <= y):
FFFFFFFFFFFFFFFF0FFFFFFFFFFFFFFF00FFFFFFFFFFFFFF000FFFFFFFFFFFFF0000FFFFFFFFFFFF00000FFFFFFFFFFF000000FFFFFFFFFF0000000FFFFFFFFF00000000FFFFFFFF000000000FFFFFFF0000000000FFFFFF00000000000FFFFF000000000000FFFF0000000000000FFF00000000000000FF000000000000000F
Less Than Gate (x < y):
0FFFFFFFFFFFFFFF00FFFFFFFFFFFFFF000FFFFFFFFFFFFF0000FFFFFFFFFFFF00000FFFFFFFFFFF000000FFFFFFFFFF0000000FFFFFFFFF00000000FFFFFFFF000000000FFFFFFF0000000000FFFFFF00000000000FFFFF000000000000FFFF0000000000000FFF00000000000000FF000000000000000F0000000000000000

Just copy and paste these into a memory bank's linear input and they should work.  By the way, the inputs are x on the left (two dots) and y on the right (one dot).
P.S.
Here is a simple ruby one-liner I made to swap 0 and F (for digital):
p gets.chomp!.split('').map!{|s| s=='0' ? 'F' : '0'}.join
You can just run it in IRB.

I may add more if I can muster up some motivation.

Last Edited By: Awesome Sauce 26 June, 2017 23:09:21. Edited 2 times

Quote    Reply   
Remove this ad
Remove this ad
avatar

Colin Hexr

Administrator
Moderator
Racial God
Old Timer

Posts: 2,459 Member Since: 6 October, 2013

#2 [url]

27 June, 2017 03:10:28

i have no clue what this is, but it looks complicated so good job!

Player of the game for four years straight. Somehow an admin.

All of my maps - http://survivalcraft.lefora.com/topic/19407424?page=1#.WPtKc45ePBI

Quote    Reply   
avatar

Stanimus

City Founder
Old Timer

Posts: 1,350 Member Since:19 July, 2014

#3 [url]

27 June, 2017 04:07:58

Gates of any sensible or random function can be implemented with the banks, since they are effectively programmable logic devices with 8 inputs and 4 outputs. I've used them to implement addition, buffering, data latch and more. I've used gates like you describe in an ALU I built.

Much of this functionality has already been detailed on the wiki (by me). A bank may also be used as a multiple function device that acts on a single operand, such as negate, invert, +1, -1, etc. The second input is the function select, in this case. Some more advanced uses are referenced in my topic, Computer Circuits in this very forum... http://survivalcraft.lefora.com/topic/19407010/Computer-Circuits

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Last Edited By: Stanimus 27 June, 2017 04:17:22. Edited 1 time.

Quote    Reply   
Remove this ad
avatar

Stanimus

City Founder
Old Timer

Posts: 1,350 Member Since:19 July, 2014

#4 [url]

27 June, 2017 14:35:52

I just made one where it takes an 'analog' in one input and a digital in the other. It replaces bit3 of the analog (hex) with the value of the digital (binary) input.

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Quote    Reply   
avatar

Awesome Sauce

Survivalist
Fully Fledged

Posts: 284 Member Since:26 December, 2014

#5 [url]

27 June, 2017 16:50:02

Wow, well next time, I might look at the wiki first. I am OK with high level programming, but you loose me at anything remotely low level. I have no idea how you guys are so good at electrics. I'm just getting into electrics now ;-). Should have payed more attention to electricity unleashed, although now that I see the uses for memory banks, you can do prettymuch anything with them. Keep up the good work Stanimus, I'll probably be using some of your guides.

Quote    Reply   
avatar

Stanimus

City Founder
Old Timer

Posts: 1,350 Member Since:19 July, 2014

#6 [url]

27 June, 2017 21:16:08

Thanks. I'm just glad to hear they might help SOMEone. I made them to save time and effort for others but honestly never really expected people to use them since they're too advanced for "the masses".
The more I work with the banks, the more I realize just how powerful and flexible they really are. I've made a "bit replacement" circuit before but just now realized it can be done with only one bank!

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Quote    Reply   
Remove this ad
Add Reply

Quick Reply

bbcode help