Postgresql Nested Case Statements In Verilog