Please help me understand this code

Following up, I think I have an acceptable solution. The bulk of the instrument is hardware based. The Arduino is used only to receive the binary count, perform the necessary math, and then display the output on an LCD. This way the count is limited only by the speed of the CMOS ICs, no need to deal with interrupts, etc.

The MC14520 8-bit counter is connected to pins 2-9. All eight pins 2-9 will be needed. The raw count should not exceed 255, as that would be an exceedingly improbable Q. Output will be displayed on 16x2 LCD, which I still have to buy, so for now the output is to the serial console. Code is simplified using only four bits and will be modified to 8 bits. I see no need for floating point math, as the count is integers.

int totalcount = 0;
int bcdValue = 0;
int multipliedcount = 0;
const int pin1 = 2;
const int pin2 = 3;
const int pin4 = 4;
const int pin8 = 5;

void setup() {

  Serial.begin(115200);
  
  pinMode(pin1, INPUT);
  pinMode(pin2, INPUT);
  pinMode(pin4, INPUT);
  pinMode(pin8, INPUT);
}

void loop() {
  
  totalcount=bcdValue;
  // Read the state of each BCD switch pin
  int value1 = digitalRead(pin1);
  int value2 = digitalRead(pin2);
  int value4 = digitalRead(pin4);
  int value8 = digitalRead(pin8);
  
  // Calculate the BCD value
  bcdValue = (value8 * 8) + (value4 * 4) + (value2 * 2) + value1;
  delay(100);

 if (bcdValue < totalcount) {(multipliedcount = totalcount * 453/100);
 Serial.println(multipliedcount);}