How to red data from ouside(example pins),not from external memory or similar?
For external (off-chip) memory, your chip design would normally provide an external memory interface, consisting of busses such as Address, Read Data, Write Data and individual pins such as Chip Select and Write Enable (perhaps broken down into individual Byte Write Enables), connected to the external pins through input or output buffer cells, according to which direction the signal is going.
To read the status of individual external signals, or to drive individual external signals, your chip design would normally include one or more General Purpose Input/Output devices (GPIOs), connected to the external pins, typically through unidirectional or bidirectional I/O buffers, depending on your requiremants. The processor would access the GPIO controller through the on-chip memory system, to read or write teh values of the GPIO pins.