Maybe these are silly question. I know almost nothing about computer science, so please let me know in the comment section if I should edit anything or delete it.
Let's say I have a function that randomly selects 8 choices of 0 or 1. Would it be written as one byte together? For example, if all choices came out as 1, would it be written as 11111111?
Also, let's say another function can select the amount of choices. Any between 1 and 8 choices of either 0 or 1. As an example, if 3 choices were selected and all came out as 1, will it be written as 111? If so, how will the program know when to go to the next function in the case that every function had to select between 1 and 8 choices of 0 or 1?