circuits 0.11.3 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2E5MjU0MjI1NDc5ZTMxOTkxMDY1YzEyZmYzNzE4OGI0NjZlZTE5ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2QxMWJiM2Y5M2M4ZDcyYmI3OWIxNjdjNGNkYmM0ZjMxNjgxMTdlZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTM2YmZiNmI2NWYyNGJhNmQ2MzMzOGM4OTRiYTFlMjhhZmJlM2I3MzQwZjMw
|
10
|
+
OTdiZmFlOTIyMjBiYWM1OTQ3NTU1YTdmNGExOTcyZGZiZDhjMTQ5MGNmYzA1
|
11
|
+
MmE1ZTcwZWY5ZTc1NTVjYmVhMzg5NzA1YjkyOTc3OTNmOTA5MjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2M4YmYwYjhiNmY4ZWM5YzgzYTc5ZTM0NDRkNGYwNDY5YTcwOTU5MjA5MzA0
|
14
|
+
NmJhNDIxZmM4MTJmMTFlNzIxNjk5ZjI3ODQ5ZTZlMzUyNDE5NGZkNmIyYjE0
|
15
|
+
YjljMmFkNjcyYjJiNzU2NzExYjJhYWJlNGI1MzgzZTQ1NWRjMTU=
|
@@ -43,8 +43,8 @@ module Circuits
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def link_or_gate(sub_components)
|
46
|
-
sub_components[:or_gate].a.set sub_components[:half_adder_carry].
|
47
|
-
sub_components[:or_gate].b.set sub_components[:half_adder_in].
|
46
|
+
sub_components[:or_gate].a.set sub_components[:half_adder_carry].c_out
|
47
|
+
sub_components[:or_gate].b.set sub_components[:half_adder_in].c_out
|
48
48
|
end
|
49
49
|
|
50
50
|
def link_outputs(sub_components)
|
@@ -10,7 +10,7 @@ module Circuits
|
|
10
10
|
and_gate = And.new
|
11
11
|
xor_gate = Xor.new
|
12
12
|
super(inputs: 2,
|
13
|
-
outputs: [:s, :
|
13
|
+
outputs: [:s, :c_out],
|
14
14
|
sub_components: [and_gate, xor_gate],
|
15
15
|
ticks: 1)
|
16
16
|
link_internals and_gate, xor_gate
|
@@ -28,7 +28,7 @@ module Circuits
|
|
28
28
|
|
29
29
|
def link_outputs(and_gate, xor_gate)
|
30
30
|
s.set xor_gate.out
|
31
|
-
|
31
|
+
c_out.set and_gate.out
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/lib/circuits/version.rb
CHANGED
@@ -12,7 +12,7 @@ describe Circuits::Component::HalfAdder do
|
|
12
12
|
subject.tick
|
13
13
|
subject.tock
|
14
14
|
expect(subject.s.get).to eq false
|
15
|
-
expect(subject.
|
15
|
+
expect(subject.c_out.get).to eq false
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -23,7 +23,7 @@ describe Circuits::Component::HalfAdder do
|
|
23
23
|
subject.tick
|
24
24
|
subject.tock
|
25
25
|
expect(subject.s.get).to eq true
|
26
|
-
expect(subject.
|
26
|
+
expect(subject.c_out.get).to eq false
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -34,7 +34,7 @@ describe Circuits::Component::HalfAdder do
|
|
34
34
|
subject.tick
|
35
35
|
subject.tock
|
36
36
|
expect(subject.s.get).to eq true
|
37
|
-
expect(subject.
|
37
|
+
expect(subject.c_out.get).to eq false
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -45,7 +45,7 @@ describe Circuits::Component::HalfAdder do
|
|
45
45
|
subject.tick
|
46
46
|
subject.tock
|
47
47
|
expect(subject.s.get).to eq false
|
48
|
-
expect(subject.
|
48
|
+
expect(subject.c_out.get).to eq true
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|