{"raw_statement":[{"iden":"statement","content":"Binary Coded Decimal(BCD) is a method of representing a value with binary notation while using the same digit places as base 10(decimal). For example, the value 783 in decimal translates to 1100001111 in standard binary, though it would instead translate to 011110000011 in binary converted decimal. This BCD converted value is composed of three chunks of 4 bits each, where each 4-bit chunk corresponds to a different digit from 783. While BCD is not used as commonly in software development, it is critical in 7-segment display systems. These circuits display a multi-digit number by splitting it into its individual digits, then sending each individual digit to a different display, creating the image of an entire number with multiple digits. Your task for this problem will be to take a base-ten decimal and to convert it into a BCD value. Each base-10 digit should be represented by four binary digits, and the individual chunks should be concatenated together to produce the final output.\n\nA single integer value that represents the value to be converted to BCD.\n\nA single binary value that represents the inputted value after being converted to BCD.\n\n"},{"iden":"input","content":"A single integer value that represents the value to be converted to BCD."},{"iden":"output","content":"A single binary value that represents the inputted value after being converted to BCD."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ d \\in \\mathbb{Z} $ be the input decimal integer, with decimal digit representation $ d = d_m d_{m-1} \\dots d_1 d_0 $, where $ d_i \\in \\{0,1,\\dots,9\\} $ and $ m+1 $ is the number of digits.\n\nLet $ b(d_i) \\in \\{0,1\\}^4 $ denote the 4-bit binary representation of digit $ d_i $, i.e., $ b(d_i) = \\text{bin}(d_i) $ padded with leading zeros to 4 bits.\n\n**Objective**  \nCompute the BCD representation as the concatenation of the 4-bit binary chunks:  \n$$\n\\text{BCD}(d) = b(d_m) \\parallel b(d_{m-1}) \\parallel \\cdots \\parallel b(d_0)\n$$  \nwhere $ \\parallel $ denotes string concatenation.","simple_statement":"Convert a decimal number to BCD: replace each digit with its 4-bit binary equivalent, then join them together.","has_page_source":false}