REDSTONEPEDIA › Circuits › Displays

7-segment display: one digit, 0 to 9, from a container's fill level

shows 0⁠–⁠9 from a container's fill level · 496 blocks · reads at a glance · one digit

One comparator reads a chest (or any container) beside it, and its 3×5 lamp face shows the signal, 0 to 9, as a digit: the fuller the container, the higher the digit. A new digit shows within 1.6 s, with no wrong lamp flickering on between digits.

no wrong lamp flashes between digits · fits in 13×10×22

shows 0–9 from a container's fill level7-segment display3D view loading (or not available in this browser)

Try it

Press play under the view to watch a demo on a loop: it fills the chest tagged A to every level from 0 to 9, one change at a time, and the face shows each digit. The A button under the view only empties the chest or fills it to the top (15, beyond the digits it shows).

How this design does it: One digit 0-9 from any container's fill level, read by one comparator: three stacked dust ladders turn the level into thresholds, and each segment ORs its runs (torches, taps and subtract comparators) on a dust bus into the face.

Build it

Download .litematic Download the design as text

The .litematic opens in Litematica (Minecraft 26.3): every block of the design in one region. The text file is the same build written as plain text, block by block.

After building it, put a chest (or any container) where the view shows the chest tagged A, and a redstone lamp in each of the 13 cells of its face: none of them is in the download or its block count. One digit only: the build is 13 blocks wide (the face is 3 of them), so copies stand 13 blocks apart and cannot make a two-digit number yet. It shows the digits of signals 0 to 9 only.

Blocks used: comparator redstone torch redstone wire repeater stone

Details: how it works, measurements and properties

In depth

one comparator reads a chest (or any container), and its 3×5 lamp face shows the signal as a digit, 0 to 9: the fuller the container, the higher the digit

How to try it

Press play under the view to watch the demo on a loop: it fills the chest tagged A to every level from 0 to 9, one change at a time (every change between two digits), and the face shows each digit; the badge names the step. The A button under the view only empties the chest or fills it to the top (15, beyond the digits it shows). Drag to look around, pinch or scroll to zoom.

Inputs and output over time

The input follows this schedule (the 3D view's demo plays the same). Lime: an input is on; orange: the output is on (taller = a stronger signal, 1 to 15). Time runs left to right in game ticks (20 ticks = 1 s).

AAABAFBBCGCCDDDEEEFGFGticks01002003004005006007008009001000110012001300140015001600170018001900200021002200230024002500260027002800290030003100320033003400

Swipe the diagram sideways: the whole sequence lasts 3461 ticks (2 min 53.05 s).

Step by step (1 lines)
  pairs: 90 states, worst latency 32 ticks (1.6 s)

Measurements

metricvaluewhat it means
latency32 ticks (1.6 s); the slowest change: 0 to 2the longest from the container's level changing to the whole face showing the new digit, over every change between two digits (the slowest change is named)
glitches25lamp changes that come and go within a change between two digits, too brief to see (under 4 game ticks); counted, not shown
on-blips0a lamp that lights wrongly for long enough to see (4 game ticks or more) during a change between two digits: 0 means no wrong lamp ever flashes

For comparison: a straightforward one-hot decoder takes 1,668 blocks for the same digit.

Notes from its designer

One digit 0-9 from any container's fill level, read by one comparator: three stacked dust ladders turn the level into thresholds, and each segment ORs its runs (torches, taps and subtract comparators) on a dust bus into the face. 496 blocks, 1.6 s, no wrong lamp flashes between values; two digits side by side need pitch 13. The obvious decoder (one-hot plus a 49-tap ROM) is 1668 blocks.

Properties

StudyDisplays
Kind7-segment display: one digit, 0 to 9, from a container's fill level
Blocks placed496 (not counting the face's lamps and the input chest the view adds)
Box13×10×22 (2860 blocks of space)
Made of (the blocks that change state)comparator, redstone torch, redstone wire, repeater
Inputs / outputsa chest (or any container) read by a comparator / the 13 lamps of its 3×5 face
Design fileseven-segment-decimal

The design file

on GitHub

Design file (287 lines)
# 7-segment display: shows 0–9 from a container's fill level · 496 blocks · reads at a glance · one digit
# https://vjeux.github.io/redstonepedia/circuits/display/seven-segment-decimal.html
name: seven-segment-decimal
circuit: seven-segment 4 hex decimal
port input.a: 0 2 2 strength
port output.a: 1 8 -21
port output.ab: 0 8 -21
port output.af: 2 8 -21
port output.b: 0 7 -21
port output.bcg: 0 6 -21
port output.c: 0 5 -21
port output.cd: 0 4 -21
port output.d: 1 4 -21
port output.de: 2 4 -21
port output.e: 2 5 -21
port output.efg: 2 6 -21
port output.f: 2 7 -21
port output.g: 1 6 -21
origin: -3 0 -20
palette:
  A minecraft:comparator[facing=south,mode=compare,powered=false]
  B minecraft:comparator[facing=south,mode=subtract,powered=false]
  C minecraft:chest[facing=south,type=single,waterlogged=false]
  D minecraft:comparator[facing=west,mode=compare,powered=false]
  E minecraft:comparator[facing=west,mode=subtract,powered=false]
  F minecraft:redstone_wire[east=side,north=side,power=0,south=side,west=side]
  G minecraft:redstone_wire[east=side,north=side,power=15,south=side,west=side]
  H minecraft:redstone_wire[power=0]
  I minecraft:redstone_wire[power=10]
  J minecraft:redstone_wire[power=11]
  K minecraft:redstone_wire[power=12]
  L minecraft:redstone_wire[power=13]
  M minecraft:redstone_wire[power=14]
  N minecraft:redstone_wire[power=15]
  O minecraft:redstone_wire[power=8]
  P minecraft:redstone_wire[power=9]
  Q minecraft:repeater[delay=1,facing=east,locked=false,powered=false]
  R minecraft:redstone_wall_torch[facing=east,lit=true]
  S minecraft:repeater[delay=1,facing=east,locked=false,powered=true]
  T minecraft:repeater[delay=1,facing=north,locked=false,powered=false]
  U minecraft:repeater[delay=1,facing=south,locked=false,powered=false]
  V minecraft:repeater[delay=1,facing=south,locked=false,powered=true]
  W minecraft:repeater[delay=1,facing=west,locked=false,powered=false]
  X minecraft:repeater[delay=1,facing=west,locked=false,powered=true]
  c minecraft:comparator[facing=east,mode=subtract,powered=false]
  r minecraft:redstone_wall_torch[facing=west,lit=true]
  s minecraft:stone
layer 0:
  .
  .
  .
  .
  .
  .
  .
  .
  .
  s.....s
  .
  s.....s
  sss.sss
  ..s.ss
  ss...s
  sss..s
  ..s..s
  ss...ss
  sss.sss
  ss
  .
  .
  .
layer 1:
  .
  .
  .
  .
  .
  .
  .
  .
  s.....s
  N.....H
  s.....s
  V..s..U
  OQQsWWH
  ssQsWHs
  IT.s.Hs
  JcQs.Hs
  ssQs.Hs
  LT.s.TH
  McQsWEH
  NSrs
  .
  ...s
  .
layer 2:
  .
  .
  .
  .
  .
  .
  .
  s
  M....sH
  .
  .
  .
  ...H
  P..H.sH
  ...H.sH
  ...H.sH
  K..H.sH
  ...H
  ...H
  ...H
  ...ss
  ...A
  ...C
layer 3:
  ....s
  ...s.s
  ....s
  ....s
  .
  ....s
  ss.s
  L....s...s
  .....H
  ...s.....s
  ..s...ssss
  ..sss.s.ss
  ...ss.ss.s
  ...s..s..s
  ..ss.....s
  ..sss....s
  ..s...ss.s
  ..s...ssss
  ..ss...sss
  .....s
  ...HDss
  .
  .
layer 4:
  ...sGs
  ....s
  ...sVs
  ...sGs
  ....s
  ...sVs
  KXsXs.s.ss
  .s..sH...N
  ...ss.ss.s
  .ssN.....V
  .sV..sWWHV
  ..OQQsWsEO
  ..sHQsWB.P
  ..sH.sWs.I
  ..JT.s...J
  ..KcQs...K
  ..L..sWH.L
  ..M..sWEWM
  ..NSrsRXXN
  .....A.s
  .....HDs
  .
  .
layer 5:
  ...GsG
  ...s.s
  ...VsV
  ...GsG
  ...s.s
  ...VsV
  .sXsssSsSM
  .V..H..s
  .s.MXsXN
  .V
  .Ls..H
  .....H
  ..Ps.H
  ..Is.H
  .....H
  .....H
  .....H
  .....H
  .....H.ss
  .......A
  .......H
  .
  .
layer 6:
  ...sFs
  ...GsG
  ...sUs
  ...sFs
  ....s
  ...sUs
  ....H.ss
  ...s...M
  ....ss
  ......s.....s
  ..Ms..sss
  ....s.s.....s
  ......ss..sss
  ....s.....s
  .....ssss..ss
  ......ss..sss
  ...........ss
  .........s
  .......HDs
  .
  .
  .
  .
layer 7:
  ...GsG
  ...s.s
  ...VsV
  ...GsG
  ...s.s
  ...VsV
  ...sssSL
  ...V.ss
  ...sSNs..s..s
  ......V..s..N
  ...Ns.LQQs..s
  ....V.M..s..V
  ....s.NSrsWWJ
  ....V....sWss
  ....sSMQQs.TL
  ......NSrsWEM
  .........sRXN
  .........A
  .........H
  .
  .
  .
  .
layer 8:
  ...sGs
  ...GsG
  ....V
  ...sGs
  ....s
  ....V
  ....V
  ....sSMs.s.ss
  ............M
  .
  .........H
  .........H
  .........H
  .........H..K
  .........H
  .........H
  .........H
  .
  .
  .
  .
  .
  .
layer 9:
  .
  .
  .
  .
  .
  .
  .
  .......NsSsSL
  .
  .
  .
  .
  .
  .
  .
  .
  .
  .
  .
  .
  .
  .
  .