Quantity Node is a variable-length Node type for representing physical quantities, numbers, currencies, and literals.

PropertyDescription
Variable length4~N words (depending on value size)
Explicit unitsSI base/derived + non-SI (currency, time, etc.)
Scale supportSI prefixes via powers of 10
Special literalsTimestamp, string (UTF-16), color (RGBA)
TID lastNode characteristic (consistent with Entity Node)

Usage: Object of Triple Edge, participant of Verb Edge, participant of Event6 Edge, entity names/labels, time expressions, etc.

Packet Structure

1st WORD (16 bits)
┌────────────────────┬────────────────────┐
│      Prefix        │       Unit         │
│      10bit         │       6bit         │
└────────────────────┴────────────────────┘

2nd WORD (16 bits)
┌──────┬──────┬──────┬────────────────────┐
│ Sign │ Size │ Type │      Scale         │
│ 1bit │ 2bit │ 1bit │       4bit         │
├──────┴──────┴──────┴────────────────────┤
│              Reserved (8bit)            │
└─────────────────────────────────────────┘

3rd+ WORD: Value (variable, 1/2/4 words depending on Size)

Last WORD (16 bits)
┌─────────────────────────────────────────┐
│                  TID                    │
│                 16bit                   │
└─────────────────────────────────────────┘
FieldBitsSizeDescription
Prefix1-10100001 000 010 (Quantity Node)
Unit11-16664 unit codes
Sign1710=positive, 1=negative
Size18-192Value word count
Type2010=integer, 1=floating-point
Scale21-244Power of 10 (offset 8)
Reserved25-328Reserved (currency code when currency)

Packet Size by Size

SizeValue wordsTotal words
001 (16 bits)4
012 (32 bits)5
104 (64 bits)7

Unit Codes (6 bits = 64)

SI Base Units (0x00~0x06)

CodeUnitSymbolPhysical quantity
0x00metermLength
0x01kilogramkgMass
0x02secondsTime
0x03ampereAElectric current
0x04kelvinKTemperature
0x05molemolAmount of substance
0x06candelacdLuminous intensity

SI Derived Units (0x07~0x1C)

CodeUnitSymbolPhysical quantity
0x07hertzHzFrequency
0x08newtonNForce
0x09pascalPaPressure
0x0AjouleJEnergy
0x0BwattWPower
0x0CcoulombCElectric charge
0x0DvoltVVoltage
0x0EfaradFCapacitance
0x0FohmΩResistance
0x10siemensSConductance
0x11weberWbMagnetic flux
0x12teslaTMagnetic field
0x13henryHInductance
0x14celsius°CTemperature
0x15lumenlmLuminous flux
0x16luxlxIlluminance
0x17becquerelBqRadioactivity
0x18grayGyAbsorbed dose
0x19sievertSvDose equivalent
0x1AkatalkatCatalytic activity
0x1BradianradPlane angle
0x1CsteradiansrSolid angle

Non-SI Units (0x20~0x2F)

CodeUnitUsage
0x20CURRENCYCurrency (extended currency code)
0x21percent% (ratio)
0x22degree° (angle)
0x23~0x28minute~yearTime units
0x29bitInformation
0x2AbyteInformation
0x2B~0x2FCOUNT~INDEXDimensionless numbers

Special Literals (0x30~0x3F)

CodeTypePayloadUsage
0x30TIMESTAMP_SEC2/4 wordsUnix timestamp (seconds)
0x31TIMESTAMP_MS4 wordsUnix timestamp (milliseconds)
0x32UTF162+N wordsUTF-16 string
0x33RGBA2 wordsColor (32 bits)

Scale (4 bits)

Power of 10. Offset 8 applied. Calculation: actual_value = Value x 10^(Scale - 8)

CodeValuePrefixCodeValuePrefix
000010⁻⁸-100010⁰ (default)-
001010⁻⁶μ100110¹da
010110⁻³m101110³k
011010⁻²c111010⁶M

Currency Extension (Unit = 0x20)

When the unit is CURRENCY, the Reserved 8 bits are used as a currency code.

CodeCurrencyISOCodeCurrencyISO
0x00US DollarUSD0x05Korean WonKRW
0x01EuroEUR0x06Swiss FrancCHF
0x02Japanese YenJPY0x07Australian DollarAUD
0x03British PoundGBP0x08Canadian DollarCAD
0x04Chinese YuanCNY0x80BitcoinBTC

Examples

“100kg” → 4 words

1st: [Prefix] + [0x01(kg)]
2nd: +, 1 word, int, ×1     → 0x0800
3rd: 0x0064 (100)
4th: TID
Interpretation: +100 × 10⁰ kg = 100kg

“$2,500,000” → 4 words (using scale)

1st: [Prefix] + [0x20(CURRENCY)]
2nd: +, 1 word, int, ×10³, USD  → 0x0B00
3rd: 0x09C4 (2500)
4th: TID
Interpretation: +2500 × 10³ USD = $2,500,000