nedoPC.org

Electronics hobbyists community established in 2002
Atom Feed | View unanswered posts | View active topics It is currently 27 Apr 2024 11:11



Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
RISC-V и реализация функций работы с тритами 
Author Message
Doomed
User avatar

Joined: 04 Jan 2016 09:15
Posts: 657
Location: Russia, S.- Peterburg
Reply with quote
TODO
Emulator-Setun-1958-Assembler ver.0.10

### 3.7. Операции над троичными числами TRS_t

```
TRS_t tests(...) :
a0=0xAAAA, a1=0xBBBB; clean_trs(a0,a1)->0 0
ts1=0x1, ts0=0x1,pos=0; get_trit(ts1,ts0,pos)->1
ts1=0x0, ts0=0x1,pos=0; get_trit(ts1,ts0,pos)->-1
ts1=0x0, ts0=0x0,pos=0; get_trit(ts1,ts0,pos)->0
ts1=0x4, ts0=0x4,pos=2; get_trit(ts1,ts0,pos)->1
ts1=0x0, ts0=0x4,pos=2; get_trit(ts1,ts0,pos)->-1
ts1=0x0, ts0=0x0,pos=2; get_trit(ts1,ts0,pos)->0
ts1=0x0000, ts0=0x0000, pos=5, val=-1; set_trit(ts1,ts0,pos,val)->32 0
ts1=0x0000, ts0=0x0000, pos=5, val=0; set_trit(ts1,ts0,pos,val)->0 0
ts1=0x0000, ts0=0x0000, pos=5, val=+1; set_trit(ts1,ts0,pos,val)->32 32
ts1=0x0080, ts0=0x0080, shift=+2; shift_trs_t11(ts1,ts0, shift)->128 128
ts1=0x0080, ts0=0x0080, shift=-3; shift_trs_t11(ts1,ts0, shift)->16 16
```

_________________
"Ученье свет, а неученье — тьма. Дело мастера боится, и коль крестьянин не умеет сохою владеть — хлеб не родится." (С)


09 Mar 2024 08:56
Profile WWW
Doomed
User avatar

Joined: 04 Jan 2016 09:15
Posts: 657
Location: Russia, S.- Peterburg
Reply with quote
TODO
Emulator-Setun-1958-Assembler ver.0.11

### 3.7. Операции над троичными числами TRS_t

```
TRS_t tests(...) :
a0=0xAAAA, a1=0xBBBB; clean_trs(a0,a1)->0 0
ts1=0x1, ts0=0x1,pos=0; get_trit(ts1,ts0,pos)->1
ts1=0x0, ts0=0x1,pos=0; get_trit(ts1,ts0,pos)->-1
ts1=0x0, ts0=0x0,pos=0; get_trit(ts1,ts0,pos)->0
ts1=0x4, ts0=0x4,pos=2; get_trit(ts1,ts0,pos)->1
ts1=0x0, ts0=0x4,pos=2; get_trit(ts1,ts0,pos)->-1
ts1=0x0, ts0=0x0,pos=2; get_trit(ts1,ts0,pos)->0
ts1=0x0000, ts0=0x0000, pos=5, val=-1; set_trit(ts1,ts0,pos,val)->32 0
ts1=0x0000, ts0=0x0000, pos=5, val=0; set_trit(ts1,ts0,pos,val)->0 0
ts1=0x0000, ts0=0x0000, pos=5, val=+1; set_trit(ts1,ts0,pos,val)->32 32
ts1=0x0080, ts0=0x0080, shift=+2; shift_trs(ts1,ts0, shift)->128 128
ts1=0x0080, ts0=0x0080, shift=-3; shift_trs(ts1,ts0, shift)->16 16
ts1=0x0100, ts0=0x0100, pos1=8,pos2=4; slice_trs ($ts1,$ts0,$pos1,$pos2)->16 16
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x00FF, tryte2.0=0xFFFF; and_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 32
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x0000, tryte2.0=0x0000; and_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 32
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x00FF, tryte2.0=0xFFFF; or_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 32
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x0000, tryte2.0=0x0000; or_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 32
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x00FF, tryte2.0=0xFFFF; xor_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 0
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x0000, tryte2.0=0x0000; xor_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 0
```

_________________
"Ученье свет, а неученье — тьма. Дело мастера боится, и коль крестьянин не умеет сохою владеть — хлеб не родится." (С)


09 Mar 2024 13:06
Profile WWW
Doomed
User avatar

Joined: 04 Jan 2016 09:15
Posts: 657
Location: Russia, S.- Peterburg
Reply with quote
Re: RISC-V и реализация функций работы с тритами
TODO
Emulator-Setun-1958-Assembler ver.0.12

Quote:
## 10.03.2024 ver.0.12
-[Х] FIX ERROR операция с тритами sum_t.
-[Х] FIX ERROR операция с тритами sum_half_t.
-[Х] Добавлен операции над трайтами add_trs, sub_trs, inc_trs, dec_trs.
-[Х] TEST:
-[ ] ERROR add_trs(...)
-[ ] ERROR sub_trs(...)
-[ ] ERROR inc_trs(...)
-[ ] ERROR dec_trs(...)



### 3.7. Операции над троичными числами TRS_t

```
TRS_t tests(...) :
a0=0xAAAA, a1=0xBBBB; clean_trs(a0,a1)->0 0
ts1=0x1, ts0=0x1,pos=0; get_trit(ts1,ts0,pos)->1
ts1=0x0, ts0=0x1,pos=0; get_trit(ts1,ts0,pos)->-1
ts1=0x0, ts0=0x0,pos=0; get_trit(ts1,ts0,pos)->0
ts1=0x4, ts0=0x4,pos=2; get_trit(ts1,ts0,pos)->1
ts1=0x0, ts0=0x4,pos=2; get_trit(ts1,ts0,pos)->-1
ts1=0x0, ts0=0x0,pos=2; get_trit(ts1,ts0,pos)->0
ts1=0x0000, ts0=0x0000, pos=5, val=-1; set_trit(ts1,ts0,pos,val)->32 0
ts1=0x0000, ts0=0x0000, pos=5, val=0; set_trit(ts1,ts0,pos,val)->0 0
ts1=0x0000, ts0=0x0000, pos=5, val=+1; set_trit(ts1,ts0,pos,val)->32 32
ts1=0x0080, ts0=0x0080, shift=+2; shift_trs(ts1,ts0, shift)->128 128
ts1=0x0080, ts0=0x0080, shift=-3; shift_trs(ts1,ts0, shift)->16 16
ts1=0x0100, ts0=0x0100, pos1=8,pos2=4; slice_trs ($ts1,$ts0,$pos1,$pos2)->16 16
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x00FF, tryte2.0=0xFFFF; and_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 32
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x0000, tryte2.0=0x0000; and_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 32
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x00FF, tryte2.0=0xFFFF; or_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 32
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x0000, tryte2.0=0x0000; or_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 32
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x00FF, tryte2.0=0xFFFF; xor_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 0
tryte1.1=0xFF00, tryte1.0=0xFFFF, tryte2.1=0x0000, tryte2.0=0x0000; xor_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->32 0
tryte1.1=0x0000, tryte1.0=0x00FF; not_trs ($tryte1_1,$tryte1_0)->255 -1
tryte1.1=0x0001, tryte1.0=0x0001, tryte2.1=0x0001, tryte2.0=0x0001; add_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->3 2
tryte1.1=0x0000, tryte1.0=0x0001, tryte2.1=0x0000, tryte2.0=0x0001; add_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->1 1
tryte1.1=0x0002, tryte1.0=0x0002, tryte2.1=0x0001, tryte2.0=0x0001; sub_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->3 0
tryte1.1=0x0000, tryte1.0=0x0001, tryte2.1=0x0000, tryte2.0=0x0001; sub_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->0 0
tryte1.1=0x0000, tryte1.0=0x0001, tryte2.1=0x0000, tryte2.0=0x0001; sub_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->1 1
tryte1.1=0x0000, tryte1.0=0x0001, tryte2.1=0x0000, tryte2.0=0x0001; sub_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->1 0
```

_________________
"Ученье свет, а неученье — тьма. Дело мастера боится, и коль крестьянин не умеет сохою владеть — хлеб не родится." (С)


10 Mar 2024 03:51
Profile WWW
Doomed
User avatar

Joined: 04 Jan 2016 09:15
Posts: 657
Location: Russia, S.- Peterburg
Reply with quote
Эмулятор троичной машины 'СЕТУНЬ' SETUN-1958 VM на языке Assembler

Ссылка: https://github.com/askfind/Emulator-Set ... embler.git

Emulator-Setun-1958-Assembler ver.0.13

TEST Ok'

Макросы работы с полем тритов:
TRITS-32 = [t31...t0] - обозначение позиции тритов в числе

Операции с тритами:
    and_t
    or_t
    xor_t
    not_t
    sum_half_t
    sum_t


Операции с трайтами:
    get_trit
    set_trit
    shift_trs
    slice_trs
    and_trs
    or_trs
    xor_trs
    not_trs
    add_trs
    sub_trs
    inc_trs
    dec_trs


Attachments:
Снимок экрана от 2024-03-10 17-55-20.png
Снимок экрана от 2024-03-10 17-55-20.png [ 245.64 KiB | Viewed 529 times ]

_________________
"Ученье свет, а неученье — тьма. Дело мастера боится, и коль крестьянин не умеет сохою владеть — хлеб не родится." (С)
10 Mar 2024 08:02
Profile WWW
Doomed
User avatar

Joined: 04 Jan 2016 09:15
Posts: 657
Location: Russia, S.- Peterburg
Reply with quote
Re: RISC-V и реализация функций работы с тритами
TODO
Emulator-Setun-1958-Assembler ver.0.14

Вывод троичного числа в тестах.

Code:
tryte1.1=0x0001, tryte1.0=0x0001, tryte2.1=0x0001, tryte2.0=0x0001;  add_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->trs : [000000000000000000000000000000+-]
 tryte1.1=0x0000, tryte1.0=0x0001, tryte2.1=0x0000, tryte2.0=0x0001;  add_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->trs : [000000000000000000000000000000-+]
 tryte1.1=0x0002, tryte1.0=0x0002, tryte2.1=0x0001, tryte2.0=0x0001;  sub_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->trs : [000000000000000000000000000000--]
 tryte1.1=0x0000, tryte1.0=0x0001, tryte2.1=0x0000, tryte2.0=0x0001;  sub_trs ($tryte1_1,$tryte1_0,$tryte2_1,$tryte2_0)->trs : [00000000000000000000000000000000]
 tryte1.1=0x0004, tryte1.0=0x0004;  inc_trs ($tryte1_1,$tryte1_0)->trs : [00000000000000000000000000000-0+]
 tryte1.1=0x0004, tryte1.0=0x0004;  dec_trs ($tryte1_1,$tryte1_0)->trs : [00000000000000000000000000000-0-]
 SETUN_trs tests(...) :

_________________
"Ученье свет, а неученье — тьма. Дело мастера боится, и коль крестьянин не умеет сохою владеть — хлеб не родится." (С)


10 Mar 2024 13:04
Profile WWW
Doomed
User avatar

Joined: 04 Jan 2016 09:15
Posts: 657
Location: Russia, S.- Peterburg
Reply with quote
Re: RISC-V и реализация функций работы с тритами
TODO

Emulator-Setun-1958-Assembler ver.0.15

Quote:
## 11.03.2024 ver.0.15
-[X] FIX ERROR inc_trs(...)
-[X] FIX ERROR dec_trs(...)

_________________
"Ученье свет, а неученье — тьма. Дело мастера боится, и коль крестьянин не умеет сохою владеть — хлеб не родится." (С)


10 Mar 2024 14:19
Profile WWW
Doomed
User avatar

Joined: 04 Jan 2016 09:15
Posts: 657
Location: Russia, S.- Peterburg
Reply with quote
ОНЛАЙН ТРАНСЛЯЦИЯ в группе Telegram "SETUN"

Доклад на тему:

"Троичные операции на ассемблере для архитектуре RISC-V. Эмуляция троичной машины "СЕТУНЬ".


Место: г.С-Петербург, Failover Bar (4-ая Советская, д. 7)
Дата: 6 апреля 2024 года.
Время: 17-00 мск.

Докладчик:
Владимир Васильев.

Приглашение от мобильных разработчиков:

Ссылка: Канал с анонсами — https://t.me/mobile_broadcast_news
По вопросам сообщества: @packovv, @CLTanuki


Attachments:
photo_2023-11-02_16-50-48.jpg
photo_2023-11-02_16-50-48.jpg [ 207.54 KiB | Viewed 288 times ]

_________________
"Ученье свет, а неученье — тьма. Дело мастера боится, и коль крестьянин не умеет сохою владеть — хлеб не родится." (С)
01 Apr 2024 11:38
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 22 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 40 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.