Sha256: 963638690c9b2c52c7c20d1a11f89e7ac892df4551899a65f6ff75d8e81e6ed3
Contents?: true
Size: 561 Bytes
Versions: 105
Compression:
Stored size: 561 Bytes
Contents
require 'HDLRuby' configure_high # An adder-suber system :addsub do input :opr [15..0].input :x,:y [16..0].output :s # The only adder instance. instance :add do [15..0].input :x,:y input :cin [16..0].output :s s <= x+y+cin end # Control part for choosing between add and sub. hif(opr) { add.(x,~y,1,s) } helse { add.(x,y,0,s) } end # Instantiate it for checking. addsub :addsubI # Generate the low level representation. low = addsubI.systemT.to_low # Displays it puts low.to_yaml
Version data entries
105 entries across 105 versions & 1 rubygems