Getting 5 bit input from a speedometer and using it to display 's','h' or 'l'

Hello Everyone!
I am new to using Arduino function, I have received a project of displaying 's', 'h' or 'l' if the 5 input bits from a speedometer is less than 10, greater than 11 and less than 21 and greater than 22 and less than 32 respectively.
I've been given only a few Nand gates, an Arduino UNO and a 7 segment display!

Pleas help.

What voltage are the signals from the speedometer ?

Forget you project for a moment. Do you know how to display 's, 'h' or 'l' on the 7 segment display ?

So you have six ranges:

0 through 9 (less than 10)
10 or 11
12 through 20 (greater than 11 and less than 21)
21 or 22
23 through 31 (greater than 22 and less than 32)
32

You have said what to do with three of the ranges. What about the other three?

if (digitalRead(Bit0Pin)==HIGH) number += 1;Assuming the signals are compatible with Arduino input pins, you can attach them to any five pins:

const byte Bit4Pin = 8;
const byte Bit3Pin = 6;
const byte Bit2Pin = 7;
const byte Bit1Pin = 5;
const byte Bit0Pin = 3;

Then turn them into a single number:

void loop()
{
  byte number = 0;
  if (digitalRead(Bit0Pin) == HIGH) number += 1;
  if (digitalRead(Bit1Pin) == HIGH) number += 2;
  if (digitalRead(Bit2Pin) == HIGH) number += 4;
  if (digitalRead(Bit3Pin) == HIGH) number += 8;
  if (digitalRead(Bit4Pin) == HIGH) number += 16;

Then group them into categories:

  switch (number)
  {
    case 0 ... 9:
      break;


    case 10 ... 11:
      break;
      
    case 12 ... 20:
      break;


    case 21 ... 22:
      break;


    case 23 ... 31:
      break;


    case 32:
      break;


    default:
      break;
  }