File size: 823 Bytes
1bda0cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
---
license: mit
tags:
- pytorch
- safetensors
- threshold-logic
- neuromorphic
---
# threshold-shiftleft4
4-bit logical left shift by 1 bit.
## Function
shiftleft4(a3, a2, a1, a0) = [a2, a1, a0, 0]
MSB (a3) is discarded, 0 shifts in at LSB.
## Examples
| Input | Output |
|-------|--------|
| 0001 | 0010 |
| 0101 | 1010 |
| 1000 | 0000 |
| 1111 | 1110 |
## Architecture
Single layer with 4 neurons copying bits to shifted positions.
| Output | Source | Weights [a3,a2,a1,a0] | Bias |
|--------|--------|------------------------|------|
| y3 | a2 | [0, 1, 0, 0] | -1 |
| y2 | a1 | [0, 0, 1, 0] | -1 |
| y1 | a0 | [0, 0, 0, 1] | -1 |
| y0 | 0 | [0, 0, 0, 0] | -1 |
## Parameters
| | |
|---|---|
| Inputs | 4 |
| Outputs | 4 |
| Neurons | 4 |
| Layers | 1 |
| Parameters | 8 |
| Magnitude | 7 |
## License
MIT
|