Small readme fix

This commit is contained in:
ogre 2019-04-28 17:15:02 +02:00
parent 1d0f5ccf51
commit b473262712
1 changed files with 11 additions and 9 deletions

View File

@ -12,7 +12,7 @@ running_disp = 0
byte_to_enc = 0xf byte_to_enc = 0xf
running_disp, encoded = EncDec8B10B.enc_8b10b(byte_to_enc, running_disp) running_disp, encoded = EncDec8B10B.enc_8b10b(byte_to_enc, running_disp)
print(hex(encoded)) print(hex(encoded))
0xba Output >> 0xba
``` ```
### Encode Control Byte ### Encode Control Byte
``` ```
@ -23,7 +23,7 @@ byte_to_enc = 0xbc # comma
ctrl = 1 ctrl = 1
running_disp, encoded = EncDec8B10B.enc_8b10b(byte_to_enc, running_disp, ctrl) running_disp, encoded = EncDec8B10B.enc_8b10b(byte_to_enc, running_disp, ctrl)
print(hex(encoded)) print(hex(encoded))
0x17c Output >> 0x17c
``` ```
### Decode Data Byte ### Decode Data Byte
``` ```
@ -32,10 +32,10 @@ from encdec8b10b import EncDec8B10B
byte_to_dec = 0xba byte_to_dec = 0xba
ctrl, decoded = EncDec8B10B.dec_8b10b(byte_to_dec) ctrl, decoded = EncDec8B10B.dec_8b10b(byte_to_dec)
print(hex(decoded)) print(hex(decoded))
0xf Output >> 0xf
# ctrl variable confirm that it was a data byte # ctrl variable confirm that it was a data byte
print(ctrl) print(ctrl)
0 Output >> 0
``` ```
### Decode Control Byte ### Decode Control Byte
``` ```
@ -44,10 +44,10 @@ from encdec8b10b import EncDec8B10B
byte_to_dec = 0x17c # comma encoded byte_to_dec = 0x17c # comma encoded
ctrl, decoded = EncDec8B10B.dec_8b10b(byte_to_dec) ctrl, decoded = EncDec8B10B.dec_8b10b(byte_to_dec)
print(hex(decoded)) print(hex(decoded))
0xbc Output >> 0xbc
# ctrl variable confirm that it was a control byte # ctrl variable confirm that it was a control byte
print(ctrl) print(ctrl)
1 Output >> 1
``` ```
### Verbosity ### Verbosity
@ -58,10 +58,12 @@ from encdec8b10b import EncDec8B10B
running_disp = 0 running_disp = 0
byte_to_enc = 0xA0 byte_to_enc = 0xA0
running_disp, encoded = EncDec8B10B.enc_8b10b(byte_to_enc, running_disp, verbose=True) running_disp, encoded = EncDec8B10B.enc_8b10b(byte_to_enc, running_disp, verbose=True)
Encoder - In: A0 - Encoded: 146 - Running Disparity: 0
Output >> Encoder - In: A0 - Encoded: 146 - Running Disparity: 0
ctrl, decoded = EncDec8B10B.dec_8b10b(encoded, verbose=True) ctrl, decoded = EncDec8B10B.dec_8b10b(encoded, verbose=True)
Decoded: A0 - Control: 0
Output >> Decoded: A0 - Control: 0
``` ```
@ -74,5 +76,5 @@ Decoded: A0 - Control: 0
### Thanks ### Thanks
- [Ryu Shinhyung](https://opencores.org/projects/async_8b10b_encoder_decoder) for creating the tables used in this module - [Ryu Shinhyung](https://opencores.org/projects/async_8b10b_encoder_decoder) for creating the tables used in this module
- [Chuck Benz](http://asics.chuckbenz.com/) for creating awesome combinatorial 8B10B modules - [Chuck Benz](http://asics.chuckbenz.com/) for creating awesome combinational 8B10B modules
- [Alex Forencich](http://www.alexforencich.com/wiki/en/scripts/matlab/enc8b10b) for his 8B10B Matlab script - [Alex Forencich](http://www.alexforencich.com/wiki/en/scripts/matlab/enc8b10b) for his 8B10B Matlab script