Sha256: 650985a5387df6339edc92a80c46f80d41478ae203b44979c8fe4ab18106301a

Contents?: true

Size: 627 Bytes

Versions: 105

Compression:

Stored size: 627 Bytes

Contents

require 'HDLRuby'

configure_high

require 'HDLRuby/std/decoder'
include HDLRuby::High::Std

# Implementation of a decoder.
system :my_decoder do
    [7..0].input :a
    [7..0].output :z

    decoder(a) do
        entry("1000uuvv") { z <= u + v }
        entry("101uuuvv") { z <= u - v }
        entry("1100uuvv") { z <= u & v }
        entry("1101uuvv") { z <= u | v }
        entry("1110uuvv") { z <= u ^ v }
        default           { z <= 0     }
    end
end

# Instantiate it for checking.
my_decoder :my_decoderI

# Generate the low level representation.
low = my_decoderI.systemT.to_low

# Displays it
puts low.to_yaml

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
HDLRuby-3.6.2 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.6.1 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.6.0 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.5.1 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.5.0 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.4.0 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.3.4 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.3.3 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.3.1 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.3.0 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.2.0 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.1.0 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-3.0.0 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-2.11.12 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-2.11.11 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-2.11.10 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-2.11.9 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-2.11.8 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-2.11.7 lib/HDLRuby/high_samples/with_decoder.rb
HDLRuby-2.11.5 lib/HDLRuby/high_samples/with_decoder.rb