rc_BCD

Version
v0.1
Requires
RedstoneChips
License
GPL v2 or v3. You can read the GPL v3 here.

rc_BCD

This is a Redstone Chip designed to decode binary input to decimal output. It was designed to replace the clock decoder using a generic chip design, so it has more features than the popular clock decoder and the included BCD decoder. The features include:

  • An offset, so you can add x to the input value (e.g. 6 for gametime offset)
  • a modulo, e.g. 12 or 24
  • an optional clock pin for each output group
  • an optional blank pin for each group, each group but the lowest or only the highest group

(You don't need a decoder for minutes anymore, since the daytime chip can output single digits now)

Usage:

Create a redstone chip with at least three input pins, a clock output, optionally a blank output and at least two data pins (A single pin does not make sense and is considered to be an error). Sign first line = "rc_BCD" next lines = (option|option argument) * where option is one of

"clocks" or "cl"
Each group has a clock pin
"blankpins" or "bps"
Each group has a blank pin
"blankpin" or "bp" without "blankpins"
you will get a blank pin on the highest group.
"blankpin" or "bp" with "blankpins"
you will get a blank pin all but the lowest group.
"bias <num>"
Add <num> to the input
"gmod <num>"
After adding the bias, calculate the modulo. Defaults to 2147483647 (2^31-1) (set this for limiting the output to e.g. 12 or 24)
"mod <num>"
The modulo for dividing the input into output groups. Defaults to 10 for decimal output. If the modulo is larger than 16, the number of output pins per group will increase. You will at least have four pins per group.

Example

A 24 hour decoder will look like:

  • 6 inputs, input 0 = clock, 1,2,3,4,5 = data
  • 9 to 11 output pins: 0 = clock, 1,2,3,4 = low digit, 5 = clock2, 6 = blank pin, 7,8,9,10 = high digit (where 9 and 10 are unused and can be omitted)
  • The sign says:
    • "rc_BCD"
    • "cl bp bias 6"
    • "gmod 24"

Example 2

A minutes decoder will look like:

  • 7 inputs, input 0 = clock, 1,2,3,4,5,7 = data
  • 9 to 10 output pins: 0 = clock, 1,2,3,4 = low digit, 5 = clock2, 6,7,8,9 = high digit (where 10 is unused and can be omitted)
  • The sign says:
    • "rc_BCD"
    • "cl"

Caveat

I do not test for negative numbers. If they result in undesired behavior (without throwing exceptions or crashing the server), don't do that then.

Changelog

  • 0.1 Initial release
Download
http://7eggert.dyndns.org/minecraft/rc_BCD.jar
http://7eggert.dyndns.org/minecraft/rc_BCD-src.tar.gz

Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files