Confused about IN/OUT architecture of z80 chip
The address bus of the Z80 is 16-bits wide (bits A0 through A15), meaning it can address 65536 locations.  The low 8 bits of the bus are bits A0-A7, which can address 256 locations.  Each of the I/O ports connected to the Z80 has a corresponding address of 0-255 (256 total addresses).  Only one port responds to a particular address.

If the contents of register C are 01H, and the contents of register D are 5AH, at
execution of OUT (C),D byte 5AH is written to the peripheral device mapped to I/O port
address 01H.


The address of the peripheral (01) will be placed on the address bus A0-A7.  The contents of the D register will be placed on the 8-bit data bus, and written to the peripheral whose port number is 01.