Try   HackMD

2017q3 Homework1 (ternary)

contributed by < hfming225 >

Balanced Ternary

Introduction

  • Balanced Ternary is a ternary (base
    3
    ) number system in which the digits have the values
    1,0,
    and
    1
    .
  • Usually,
    1
    is represented as overturned
    1
    :
    "T"
    .
  • We can use the Bal3 at the subscript to show which number system it belong to.

e.g.

T101.11Bal3.

Conversion

Bal3 to Dec

Given a number
AN1AN2A0.B1B2BM

,which is repersent in Balanced Ternary

M,NN and Ak,Bi{T,1,0}

Use the following formula:

k=0N1Ak×3k+i=1MBi×3i
We can convert
Bal3
to
Dec
.

e.g.

1T0.T01=1×32+(1)×31+0×30+(1)×31+0×32+1×33=9+(3)+0+(13)+0+127=5.7037Dec=51927

Dec to Bal3

Now we try to convert

Dec back to
Bal3

Take the number
51927

Round to
6
and
827
(because 5.7 is closed to 6)

Divided it into integer and frcation.

For integer part:

6÷3=2, remainder 02÷3=23 round to 1, remainder 11÷3=13 round to 0, remainder 1
So we get the integer part
1T0

For fraction part:

827×3=8/9=1+1/9,B1=1,19×3=1/3=0+1/3,B2=0,13×3=1+0,B3=1,B4,B5....=0
So we get the fraction part
T01

In conclusion,

51927=1T0.T01Bal3

positive and nagetive Number

When we represent number in Binary or Ternary, notice that one more digit is needed to show positive or negative.

But in the

Bal3, because of
Ak,Bi{T,1,0}

Let every digit times -1, get the opposite number,

e.g

1T0.T01
opposite number=T10.10T

Balanced Tarnery Adder

Three-valued logic

There are three value in Tarnery system.
-1 for false, 0 for unknow, 1 for true.
We can use these vaule to build follow truth table.

Truth table

NEG

a
a¯
T
1
0
0
1
T

a¯=a×1

AND

ab
T
0
1
T
T
T
T
0
T
0
0
1
T
0
1

ab=min ( a, b )

OR

ab
T
0
1
T
T
0
1
0
0
0
1
1
1
1
1

ab=max ( a, b )

Half Adder

With above logic operation, try to build a half adder
By logic design we try to make follow circuit

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Now, we need "SUM" and CONS.

Truth table

input a
input b
ouput ci+1
output si
T
T
T
1
T
0
0
T
T
1
0
0
0
T
0
T
0
0
0
0
0
1
0
1
1
T
0
0
1
0
0
1
1
1
1
T

In article Balanced Full Adder
Imply that

si=a+b=( ( a=1 )  ( b1 ) )   ( ( a=0 )  ( b ) )  ( ( a=1 )  ( b+1 ) )
ci+1=ab=cons ( a, b )=( a  b )  ( ( a1 ) 0 )  ( ( b1 )  0 )

Full Adder

With concept of half adder we can get a full adder.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Pros and cons

Advantage

  1. Easier than binary to do addition, subtraction and mutiplication.

Because signed and unsigned are balanced, so subtraction is same as addition with negative.

  1. Low Radix Economy which estimate the efficiency of the number system.

Disadvantage

  1. Difficult to make a three type voltage circuit.

Now our transitor is low voltage, hard to make it in three voltage stablely.

  1. Division is harder than binary, needed another "trit" to implement.

Ternary Division

Application

IOTA, Introduction

  • IOTA is a new cryptocurrency that focused on Machine-2-Machine (M2M) transactions.
  • It provides efficient, secure, lightweight, real time micro-transactions without fees.
  • It is open-source, decentralized cryptocurrency, engineered for Internet of Things.
  • Its real-time micro transactions and providing ecosystem that is ready and flexible for scale.

IOTA core : Tangle

  • IOTA is based on Tangle instead of blockchain.
  • Tangle vs. Blockchain
    • Tangle retain the blockchain features of the distributed ledger and secure transactions.
    • Instead of blockchain, Tangle uses the form of a Directed Acyclic Graph (DAG).

Directed Acyclix Graph (DAG)
Why is DAG better than blockchain? Because DAG technology enables various features like zero-cost transactions, infinite scalability or offline transactions that blockchain simply cannot do and will neither probably be developed to do.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

IOTA structure is like the ( C ) in picture.

[Why is iota ternary]

  • Radix economy in base on 3 is lowest.
  • Ternary 3 states perform transaction very balanced, which is quite helpful to build a self-organizing and self-sustaining network like the tangle.

Reference

Wikipedia : Balanced Ternary
The Balanced Ternary Machines of Soviet Russia
Balanced Full Adder
IOTA討論
the tech behind iota
Tangle
How IOTA makes bright future for Internet of Things